-
-
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
Running tests that match string causes non-matching suites to fail #6415
Comments
@rickhanlonii ideas? |
By the way, I'd love to try and open a PR to fix this, but I'd probably need a bit of guidance on where to start in the codebase. |
Oh that's a great find @Crispioso, I confirmed the bug with your repo To fix:
|
Thanks @rickhanlonii, I'll try take a look at this over the weekend then. |
Let me know if I can help! |
@rickhanlonii I'm having problems making edits to The error:
Happy to post this question elsewhere as I'm aware it's not directly related to the original issue. |
You need to run watch mode to compile - the source code contains flow which is not valid js |
I ran |
Okay so I think it's VSCode that is causing me problems, I'm not sure why or how but the same issues don't happen when I edit it in a simple text editor π€ |
I'm not sure whether it's VSCode causing your issues, but for me it doesn't make a difference. This reproduces for me 100% of the time. |
I'm getting this issue with It's worth noting that this only seems to be an issue with jest version >= 23.1 Rolling back to jest v22.4.4 fixes this. However, rolling back will cause flags to go up with david-dm so is less than ideal, so using jest-cli 24.x for test filtering with regex for now while leaving the package version at 23.2 as a work around |
lol, after reading things more carefully I now realize that the VSCode reference was entirely unrelated to the bug itself. Sorry about that! π You can disable auto-formatting in your settings: |
## Summary Fix a regression on jest-jasmine for non marching test suites. #6415 ## Test plan https://github.com/Crispioso/possible-jest-bug
Closed via #6657 |
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. |
π₯ Regression Report
When I set the
-t
CLI option to filter what tests are run, if there is a suite that doesn't have any tests that match the string then it fails with:My expectation would be that it behaves the same as v22, where any suites that have no matching tests are skipped.
Sorry if this issue already exists, I looked for it but couldn't find anything that matched this problem. I've also looked in the v23 changelog and couldn't see this being a known breaking change.
Last working version
Worked up to version: 22.4.4
Stopped working in version: 23.0.0
To Reproduce
Steps to reproduce the behavior:
Clone my repo (https://github.com/Crispioso/possible-jest-bug) and run the following commands in both
/v22
and/v23
directories:They both run the same tests and apply
-t false
so that it only runs tests with the string 'false' in their title.v22 skips the suite which has no matching tests whereas v23 throws an error instead.
Expected behavior
v23 to skip test suites that have no tests in them that match the
-t
patter, rather than error.Link to repl or repo (highly encouraged)
https://github.com/Crispioso/possible-jest-bug
Run
npx envinfo --preset jest
Paste the results here:
v23:
System: OS: macOS Sierra 10.12.6 CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz Binaries: Node: 8.9.3 - /usr/local/bin/node Yarn: 1.0.2 - /usr/local/bin/yarn npm: 5.5.1 - /usr/local/bin/npm npmPackages: jest: 23.0.0 => 23.0.0
v22:
System: OS: macOS Sierra 10.12.6 CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz Binaries: Node: 8.9.3 - /usr/local/bin/node Yarn: 1.0.2 - /usr/local/bin/yarn npm: 5.5.1 - /usr/local/bin/npm npmPackages: jest: 22.x => 22.4.4
The text was updated successfully, but these errors were encountered: