Skip to content

Commit

Permalink
maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 16, 2020
1 parent 69c898f commit a58d262
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 @@ -87,6 +87,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 a58d262

Please sign in to comment.