beforeAll: not skipped within describe.skip
See original GitHub issue🐛 Bug Report
beforeAll
functions are run even when defined inside of a describe.skip
block.
To Reproduce
- Define a
describe.skip
block. - Define a
beforeAll
inside thedescribe.skip
block. - Do something within the
beforeAll
function to confirm that it does or does not get run (e.g. add aconsole.log
statement, set some flag, etc.).
Expected behavior
The function registered by the beforeAll
is never executed.
Link to repl or repo (highly encouraged)
https://repl.it/repls/UsableBurlyJavascript
Run npx envinfo --preset jest
Paste the results here:
[4mSystem:[0m
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
[4mBinaries:[0m
Yarn: 1.2.1 - ~AppData\Roaming\npm\yarn.CMD
npm: 6.0.0 - C:\Program Files\nodejs\npm.CMD
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:6 (1 by maintainers)
Top Results From Across the Web
beforeAll: not skipped within describe.skip (again) · Issue #8379
Bug Report beforeAll functions are run even when defined inside of a describe.skip block. To Reproduce Define a describe.skip block.
Read more >How to skip all tests if beforeAll failed? Using Jasmine and ...
1 Answer 1 · I've tried protractor-fail-fast but in the case when beforeAll fails - the first it in the file still marked...
Read more >Globals - Jest
Beware that the describe block will still run. If you have some setup that also should be skipped, do it in a beforeAll...
Read more >Setup and teardown - Pester
BeforeAll is used to share setup among all the tests in a Describe / Context including all child blocks and tests. BeforeAll runs...
Read more >Mocha documentation — DevDocs
This will skip all it , beforeEach/afterEach , and describe blocks within the suite. before/after hooks are skipped unless they are defined at...
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
This issue still remains when using the default
jasmine2
runner.I’ve made this gist with the same code as the issue’s repl using the latest version from Jest.
Output
Default
jasmine2
runnerUsing
jest-circus
Installing
jest-circus
and running the same gist withJEST_CIRCUS=1
produces the following output: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.