-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
🐛 Bug Report
Errors thrown in afterAll inside a describe can cause a test suite to fail silently.
This bug was previously reported under #3266 and fixed under #5884 - but the fix addresses errors in an afterAll at the top level, not inside a describe.
To Reproduce
describe('broken afterAll', () => {
afterAll(() => {
expect(1).toEqual(2);
});
it('should pass regardless.', () => {});
});
Expected behavior
The test suite should fail, like it does if the error were thrown in a top-level afterAll.
Link to repl or repo (highly encouraged)
https://repl.it/HAYG/1 (same repl as #3266 - thanks @gdborton)
As of writing repl.it is only running jest 22.1.2 whereas the fix for #3266 was released in 23.0.0. However the issue is present in the latest version of 23.4.1.
Run npx envinfo --preset jest
Paste the results here:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Node: 10.6.0 - /usr/local/bin/node
npm: 6.1.0 - /usr/local/bin/npm
npmPackages:
jest: 23.4.1 => 23.4.1
medikoo
Metadata
Metadata
Assignees
Labels
No labels