-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
afterAll hook hides errors. #3266
Comments
In addition, this functionality is critical for global |
yes! we absolutely need this! |
It could presumably be fixed upstream in jasmine as well? |
Does jest not use jasmine internally? It looks like this works as intended in jasmine 2.5 at least. |
So I dug into this a bit, and it looks like Jasmine is assigning most errors to It seems that Jest is only looking at exceptions that happen in
Still looking for where Jest handles these. |
So, you can get the results of the suite here - https://github.com/facebook/jest/blob/master/packages/jest-jasmine2/src/reporter.js#L73 There is an unused argument passed to
This doesn't match against the I don't think I'd be able to PR this any time soon. |
any work around for this? 😕 |
Different context on the same issue (marked as a duplicate): #3785 |
Working on it :) |
Summary: The `loadRepository` test tries to clean up temporary directories, but failed to do so because the directories were not empty. The cleanup hook threw an error, but this error was silenced by Jest due to [a known bug][1] that was fixed a few days ago. We can fix this by asking `tmp` to clean up directories even if they are not empty, using the `unsafeCleanup` option. [1]: jestjs/jest#3266 Test Plan: While running `watch -n 0.1 'ls /tmp | grep "tmp-.*" | wc -l'`, run tests. Note that the number increases by five and then drops down again; before this patch, it would increase by 5 and then stay there. wchargin-branch: clean-up-tmpdirs
Summary: The `loadRepository` test tries to clean up temporary directories, but failed to do so because the directories were not empty. The cleanup hook threw an error, but this error was silenced by Jest due to [a known bug][1] that was fixed a few days ago. We can fix this by asking `tmp` to clean up directories even if they are not empty, using the `unsafeCleanup` option. [1]: jestjs/jest#3266 Test Plan: While running `watch -n 0.1 'ls /tmp | grep "tmp-.*" | wc -l'`, run tests. Note that the number increases by five and then drops down again; before this patch, it would increase by 5 and then stay there. wchargin-branch: clean-up-tmpdirs
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Bug 🐛
What is the current behavior?
Errors thrown in
afterAll
are caught somewhere in Jest, and can cause a test suite to fail silently.See the repl here - https://repl.it/HAYG/1
What is the expected behavior?
The
afterAll
hook should respect errors that are thrown, the same way thatbeforeAll
does.Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: