🐛 Bug Report
When a test fails inside jest.isolateModules callback, the sandbox registry doesn't close, causing all other tests using isolateModules to fail.
To Reproduce
it("Should fail", () => {
jest.isolateModules(() => {
expect(true).toBe(false);
});
});
it("Should pass", () => {
jest.isolateModules(() => {
expect(true).toBe(true);
});
});
Expected behavior
Should fail the first tests, but the other test should pass.
Link to repl or repo (highly encouraged)
https://repl.it/@maayanbar/Jest-isolateModules
envinfo
System:
OS: Windows 10 10.0.18362
CPU: (8) x64 Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
Binaries:
Node: 12.12.0 - D:\Program Files\nodejs\node.EXE
Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.11.3 - D:\Program Files\nodejs\npm.CMD