-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix runs beforeAll/afterAll in excluded suites (#4820) #6234
Conversation
This is awesome, thanks for tackling it! Mind adding an integration test? |
CHANGELOG.md
Outdated
@@ -168,6 +168,8 @@ | |||
regardless of order ([#6150](https://github.com/facebook/jest/pull/6150)) | |||
* `[pretty-format]` [**BREAKING**] Remove undefined props from React elements | |||
([#6162](https://github.com/facebook/jest/pull/6162)) | |||
* `[jest-cli]` Fix run beforeAll in excluded suites | |||
tests" mode. ([#4820](https://github.com/facebook/jest/issues/4820)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should point to the PR, not the issue 🙂
I wanted to add an integration test, but I didn't find how to, and I had no time to dig how those tests worked, I'll try to take the time by the end of the week |
@SimenB Sorry, but I really have no idea of where / how to test it, right now, I still have not undestood how tests works in jest :( |
All the directories in https://github.com/facebook/jest/tree/master/e2e are integration tests. They each have a corresponding test in https://github.com/facebook/jest/tree/master/e2e/__tests__ which spawns up a jest instance. You can look at e.g, https://github.com/facebook/jest/tree/master/e2e/before-each-queue for an example of a test with hooks and assertions on the output. @rickhanlonii any progress on that contributing guide? :) |
arf, I was trying to play in the folder |
I'm confused, it seems to work on my machine (as usual) but fails on the CI |
We're in the process of replacing jasmine as the underlying runner with jest-circus (#6295). If you run |
Codecov Report
@@ Coverage Diff @@
## master #6234 +/- ##
==========================================
- Coverage 63.89% 63.81% -0.08%
==========================================
Files 228 228
Lines 8705 8717 +12
Branches 4 4
==========================================
+ Hits 5562 5563 +1
- Misses 3142 3153 +11
Partials 1 1
Continue to review full report at Codecov.
|
I had no clue there were two different runner :) |
It's quite fresh, don't tell anyone 😉 |
@aaronabramov mind taking a quick look at the circus implementation? |
just rebased |
wait.. it should already work in |
ah yeah.. i see! we do still run hooks even if it's skipped. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Disable run of beforeAll when test suite is desactivated
Summary
Test plan
run using
jest test.js --testNamePattern="test 1"
Logs before the modification:
Logs after the modification: