vscode-jest
vscode-jest copied to clipboard
Whenever I create a new file, the Jest extension creates a popup with an error message, even though I have test auto-running disabled
Every time I create a file of any type in a project that has Jest installed as a dependency, the output for Jest opens with an error.
not-test-4 is scheduled
not-test onProcessExit: process exit with code=127, signal=undefined
see troubleshooting: https://github.com/jest-community/vscode-jest/blob/master/README.md#troubleshooting
Environment
-
vscode-jest version
: 4.6.0 -
node -v
: 16.15.1 -
npm -v
oryarn --version
: 8.13.2 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): - your vscode-jest settings if customized:
- jest.jestCommandLine?
- jest.autoRun? off
- anything else that you think might be relevant?
- Operating system: Kubuntu 22.04
Prerequisite
- are you able to run jest test from the command line? Yes
- how do you run your tests from the command line? (for example:
npm run test
ornode_modules/.bin/jest
) npm t
Steps to Reproduce
- Open a project that has Jest installed as a dependency
- Create a file of any type (I made a
hello.txt
) - The panel opens with an error message.
Relevant Debug Info
Expected Behavior
The panel doesn't open. I am able to create files without having annoying popups breaking my workflow.
Actual Behavior
The bottom panel opens with the error quoted at the top of this issue.
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...
hi, yes it's true that when a file change (add/delete/rename) is detected, we asked jest to verify if it is a test file. The culprit of the issue seems to be the fact that we can't start jest or node, indicated by error code 127 - which usually means the command is not found. This is the issue you would need to address eventually if you want the extension to run jest tests for you. Please look at the Jest failed to run section, and see if you can spot more info.
Setting autoRun
to "off" does turn off the automatic jest run but it won't stop the test detection because the user can still run tests manually via the gutter menu or TestExplorer. I think once we address the root cause above, this should not be the problem.
this should be fixed via #898