Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforeAll inside skipped describe is executed when using the jasmine2 runner #6755

Closed
mlopezluque opened this issue Jul 25, 2018 · 6 comments 路 Fixed by #9931
Closed

beforeAll inside skipped describe is executed when using the jasmine2 runner #6755

mlopezluque opened this issue Jul 25, 2018 · 6 comments 路 Fixed by #9931

Comments

@mlopezluque
Copy link

馃悰 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:

  1. Have a test with a describe.skip
  2. Have a beforeAll inside this skipped describe
  3. 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
@jamesmillerburgess
Copy link

We also have this problem with some puppeteer integration tests that have a very long setup time. It would be great if the beforeAll block didn't get executed, as it would save us a lot of CI time.

@SimenB
Copy link
Member

SimenB commented Aug 15, 2018

I doubt we'll fix this unless somebody from the community does it. If Circus works correctly I recommend just using that

@jamesmillerburgess
Copy link

Ok, thanks for confirming the behavior isn't intentional. I'll see if I can submit a fix soon.

@cr0cK
Copy link

cr0cK commented Mar 17, 2019

What's the news about this bug? It sounds to me to a major bug and it seems not so complicated to fix. If jest-circus is the solution, why don't you set it by default in a next major version?

@SimenB
Copy link
Member

SimenB commented Mar 17, 2019

It will be the default in the next version

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants