question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:6

github_iconTop GitHub Comments

1reaction
SimenBcommented, Mar 17, 2019

It will be the default in the next version

0reactions
github-actions[bot]commented, May 11, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found