We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3eeefb9 commit e6471feCopy full SHA for e6471fe
src/__tests__/waitFor.test.tsx
@@ -226,14 +226,13 @@ test.each([true, false])(
226
throw new Error('test');
227
});
228
229
- try {
230
- await waitFor(() => mockErrorFn(), {
231
- timeout: 6,
232
- interval: 2,
233
- });
234
- } catch (e) {
235
- // do nothing
236
- }
+ await expect(
+ async () =>
+ await waitFor(() => mockErrorFn(), {
+ timeout: 6,
+ interval: 2,
+ })
+ ).rejects.toThrow();
237
238
// Verify that even though time to perform check is longer than interval
239
// test won't timeout until number of checks * interval >= timeout
0 commit comments