-
Notifications
You must be signed in to change notification settings - Fork 458
Jest freeze on Error when autoMock and collectCoverage are both true #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A little more info as I'm investigating the bug here. The issue seems to be coming from the jest |
@Debrice this does seem like a hoisting issue. A quick workaround is to configure ts-jest to skip babel /cc @GeeWee |
You're right @kulshekhar , skiping babel prevents the test from hanging but creates a new error. If I update the test to read (so it breaks on purpose): jest.unmock("../index");
import foo from "../index";
it("will hang", () => {
expect(()=>foo("test")).not.toThrow();
}) Running the test with
Note: I had to move the |
@kulshekhar, you are right. I decided not to mention the removal of Once all my tests pass, I turn on collectCoverage and run another pass... it has become more or less a "first world problem" at this point. |
Seems strange with the hoisting issue. We're running things through the same transform jest is, so the issue should manifest in plain jest as well if it's related to that. |
Uh oh!
There was an error while loading. Please reload this page.
Test freeze on error when jest
autoMock
andcollectCoverage
are set to true.Test should display the error and move on to the next test. The same jest settings work on my babel projects.
https://github.com/debrice/jest-hang-bug
The text was updated successfully, but these errors were encountered: