beforeAll block runs even if it is inside a describe.skip block
See original GitHub issue🐛 Bug Report
To Reproduce
describe.skip('CommentsSummaryEmail', () => {
beforeAll(async () => {
console.log('WTF are you doing jest')
})
it('should whatever', async () => {
expect(0).toBe(0)
})
it.todo(
`it whateves`
)
})
Expected behavior
none of the block inside describe.skip run
Link to repl or repo (highly encouraged)
envinfo
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
npmPackages:
jest: ^26.4.2 => 26.4.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top Results From Across the Web
how to control order of execution of beforeAll blocks in ...
I have a main test with sub-tests which follows the following structure: describe('main test', () => { describe('happy path', ...
Read more >Setup and Teardown - Jest
By default, the beforeAll and afterAll blocks apply to every test in a file. You can also group tests together using a describe...
Read more >BeforeAll - Pester
BeforeAll is used to share setup among all the tests in a container, Describe or Context including all child blocks and tests. BeforeAll...
Read more >API Reference | Vitest
Use describe.skip in a suite to avoid running a particular describe block. ts
Read more >Globals - Jest 中文文档
If beforeEach is inside a describe block, it runs for each test in the describe block. If you only need to run some...
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
Thanks @SimenB . I have done the fixes and will raise a PR after adding few unit tests. I have addressed the below issues in both
jest-circus
&jest-jasmine2
describe.skip
block when theit
block contains tests marked astodo
oronly
it
tests run even if it is inside adescribe.skip
when theit
tests are marked astodo
oronly
Side note:
beforeEach
also runs (when nested in adescribe.skip
).EDIT:
beforeEach
is skipped as expected, sorry.