Skip to content

Commit

Permalink
maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Aug 7, 2020
1 parent b072714 commit 0ee0a52
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/jest-core/src/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ async function createOpenHandlesResult(
// wait 100ms to allow some handles to be cleaned up, including Jest's internal timeouts
// make sure _not_ to unref it, otherwise the promise won't actually be waited for if there's nothing else to do
await new Promise(resolve => setTimeout(resolve, 100));
// wait one extra tick so the timeout ^ is not counted.
await Promise.resolve();

const handlesAfterWait = collectHandles(false);
const handlesAfterStack = handlesAfterWait.map(handle => handle.stack);
Expand Down

0 comments on commit 0ee0a52

Please sign in to comment.