Skip to content

Commit

Permalink
chore: attempt to fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 25, 2019
1 parent 086766d commit 7484c1d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions e2e/override-globals/__tests__/index.js
Expand Up @@ -15,8 +15,16 @@ describe('parent', () => {
});

describe('child', () => {
it('works well', () => {
expect(() => new Promise()).toThrow('Booo');
it('works well', done => {
// A timeout to guarantee it doesn't finish after 0 ms
setTimeout(() => {
try {
expect(() => new Promise()).toThrow('Booo');
done();
} catch (e) {
done.fail(e);
}
}, 10);
});
});
});

0 comments on commit 7484c1d

Please sign in to comment.