Running jest in watch mode with an invalid file pattern causes jest to throw an exception.
See original GitHub issueš 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:
npx: installed 1 in 3.086s
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Binaries:
Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
npmPackages:
jest: ^23.6.0 => 23.6.0
Note: I can make a PR for this if this behaviour is indeed not the desired behaviour.
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (6 by maintainers)
Iām getting the same error on
24.0.0-alpha.6
when runningnpm test
(which runsjest
with no arguments). My config is empty. Removingnode_modules
and re-installing did not fix the issue for me.@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