-
-
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 jest in watch mode with an invalid file pattern causes jest to throw an exception. #7382
Comments
Yeah, that's not desired behavior. PR very much welcome! Providing an invalid pattern in non-watch mode prints an error ( Personally I think an invalid error should exit (with code |
@natealcedo @SimenB Can I pick it up? |
@SerhiiBilyk go for it! I'm actually not sure if it's too advanced, you should be able to grep your way to where the text is printed and where the error is thrown. Feel free to ask questions 🙂 |
@SimenB I have found the code which is need to be fixed. ● Unrecognized CLI Parameters:
Following options were not recognized:
["changed-files-with-ancestor", "clear-cache", "clear-mocks", "collect-coverage", "detect-leaks", "detect-open-handles", "error-on-deprecated", "find-related-tests",
"force-exit", "last-commit", "list-tests", "log-heap-usage", "map-coverage", "no-stack-trace", "only-changed", "only-failures", "pass-with-no-tests", "reset-mocks", "reset-modules", "restore-mocks", "run-in-band", "run-tests-by-path", "show-config", "skip-filter", "test-location-in-results", "update-snapshot", "use-stderr", "watch-all", "notify-mode", "prettier-path"]
CLI Options Documentation:
https://jestjs.io/docs/en/cli.html
[nodemon] app crashed - waiting for file changes before starting... What I'm doing wrong? |
@SerhiiBilyk what command are you running? Are you sure you checked out and pulled master? |
@rickhanlonii yes, I'm sure.
What I'm doing wrong? |
Those steps should work - do you have a link to your jest fork so I can try? |
Hm, did you manually fork that? It would be pretty difficult for me to verify that fork before running it, can you fork it through github and try that way? |
@rickhanlonii oh, sorry, anyway it was most fresh clone. |
I'm not sure what's the best place to report jest@beta issues, but I'm also getting above mentioned "Unrecognized CLI Parameters" error. Minimal repro case:
|
It is strange, because I'm running |
This is v weird, @SerhiiBilyk I ran your fork with no troubles Can you both post the result of |
@rickhanlonii |
@rickhanlonii after removing node_modules (rm rf), and installing it again, it works as expected. I don't know why. I did it previously, but it wasn't work |
I'm getting the same error on $ npx envinfo --preset jest
npx: installed 1 in 1.477s
Path must be a string. Received undefined
npx: installed 1 in 1.483s
C:\Users\b\AppData\Roaming\npm-cache\_npx\15536\node_modules\envinfo\dist\cli.js
System:
OS: Windows 10
CPU: (12) x64 Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz
Binaries:
Yarn: 1.10.1 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD |
Let's track the failed jest@beta runs in #7424 and keep this issue on track to fix the og issue 👌 |
|
Will defer to @SimenB, I'm not familiar with the issue |
1 nah, it should always fail |
@SimenB Do I need run all tests in watch mode if regexp will be invalid? |
Ah! No, just print an error and wait for the user to change the pattern |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
🐛 Bug Report
Running Jest in watch mode and providing an invalid file pattern causes Jest to error and the process freezes. You have to send the process a SIGINT to kill the process, basically control + c
To Reproduce
Steps to reproduce the behavior:
Run jest in watch mode and filter by file name (Press P). Provide
*
as a pattern and the following is observed.Do this.
And this is what happens
Only way to kill jest is to press control + c.
Expected behavior
Jest is known for its pleasant developer experience. This exception should return a developer friendly error and not cause Jest to hang with the only way of stopping it is to do a control + c;
Link to repl or repo (highly encouraged)
Not needed as it is easy to replicate.
Run
npx envinfo --preset jest
Paste the results here:
Note: I can make a PR for this if this behaviour is indeed not the desired behaviour.
The text was updated successfully, but these errors were encountered: