Skip to content

Commit

Permalink
Fix Jest open handle in DeltaBundler resolver test
Browse files Browse the repository at this point in the history
Summary:
This test was leaving dangling open handles in Jest because the "resolver" (containing a whole instance of `DependencyGraph`, watcher and all) wasn't properly ended.

`resolver` is automatically cleaned up in `afterEach` with `resolver.end()`, but in this test we were successfully creating a resolver instance without assigning it to `resolver`, leaving it hanging.

Changelog: Internal

Reviewed By: huntie

Differential Revision: D48783493

fbshipit-source-id: 711a2bc5879f4eb093e8ddf2fbc71a2804c7d976
  • Loading branch information
robhogan authored and facebook-github-bot committed Aug 29, 2023
1 parent 495afac commit 0c58d4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/metro/src/DeltaBundler/__tests__/resolver-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ function dep(name: string): TransformResultDependency {
},
});

await expect(createResolver(config)).resolves;
resolver = await createResolver(config);
expect(console.error).not.toHaveBeenCalled();
});
});
Expand Down

0 comments on commit 0c58d4a

Please sign in to comment.