Skip to content

Commit 7484c1d

Browse files
committed
chore: attempt to fix flaky test
1 parent 086766d commit 7484c1d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

e2e/override-globals/__tests__/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@ describe('parent', () => {
1515
});
1616

1717
describe('child', () => {
18-
it('works well', () => {
19-
expect(() => new Promise()).toThrow('Booo');
18+
it('works well', done => {
19+
// A timeout to guarantee it doesn't finish after 0 ms
20+
setTimeout(() => {
21+
try {
22+
expect(() => new Promise()).toThrow('Booo');
23+
done();
24+
} catch (e) {
25+
done.fail(e);
26+
}
27+
}, 10);
2028
});
2129
});
2230
});

0 commit comments

Comments
 (0)