beforeAll inside skipped describe is executed when using the jasmine2 runner
See original GitHub issue🐛 Bug Report
beforeAll
inside skipped describes are executed regardless. This was already reported in #6166 and closed with #6234, but from what I’ve seen the problem remains when using the default jasmine2
runner. I wasn’t able to reproduce the bug when using the jest-circus
runner.
To Reproduce
Steps to reproduce the behaviour:
- Have a test with a
describe.skip
- Have a
beforeAll
inside this skipped describe - Add some code inside the
beforeAll
to check if it is being executed
Expected behavior
The code from a beforeAll
should not be executed when the describe it is part of is skipped.
Link to repl or repo (highly encouraged)
Repository showcasing the bug: https://github.com/mlopezluque/jest-beforeall-skipped-test
Run npx envinfo --preset jest
Paste the results here:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
Yarn: 1.3.2 - /usr/local/bin/yarn
npm: 6.1.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
npmPackages:
jest: ^23.4.1 => 23.4.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:6
Top Results From Across the Web
jasmine2: how to handle failing beforeAll - Stack Overflow
Skipping out in the middle of the spec run (this issue) is a bit more complicated, because depending on the type of error,...
Read more >Your first suite - Jasmine Documentation
Suites can be disabled with the xdescribe function. These suites and any specs inside them are skipped when run and thus their results...
Read more >Setup and Teardown - Jest
When they are inside a describe block, the beforeAll and afterAll ... If you are using jasmine2 test runner, take into account that...
Read more >jest-jasmine2 | Yarn - Package Manager
... beforeAll & afterAll hooks getting executed even if it is inside a skipped describe block (#10806); [jest-circus] Fix testLocation on Windows when...
Read more >npm:jest-test-each | Skypack
run parametrised tests easily [typesafe] without text tables or arrays of ... You can add the following in jest.config.js to use 'jest-jasmine2' runner:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It will be the default in the next version
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. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.