Skip to content

Commit

Permalink
chore: wait 100ms before checking for leaks
Browse files Browse the repository at this point in the history
Ref #8686
  • Loading branch information
SimenB committed Aug 23, 2019
1 parent fa8ef22 commit 6e6a8e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/jest-runner/src/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ export default async function runTest(
);

if (leakDetector) {
// We wanna allow a tiny but time to pass to allow last-minute cleanup
await new Promise(resolve => setTimeout(resolve, 100));

// Resolve leak detector, outside the "runTestInternal" closure.
result.leaks = await leakDetector.isLeaking();
} else {
Expand Down

0 comments on commit 6e6a8e8

Please sign in to comment.