vscode-jest
vscode-jest copied to clipboard
No test match when running an independent test
Environment
Created this issue as a followup of https://github.com/jest-community/vscode-jest/issues/838#issuecomment-1100942231
-
vscode-jest version
: 4.2.1 -
node -v
: 16.14.0 -
npm -v
: 8.3.1 -
npm ls react-scripts
: 4.0.3 - your vscode-jest settings if customized:
- jest.jestCommandLine? - see .vscode in attached repro
- jest.autoRun? see .vscode in attached repro
- Operating system: [fill]
Prerequisite
- are you able to run jest test from the command line?
npm run test
- how do you run your tests from the command line? (for example:
npm run test
ornode_modules/.bin/jest
)npm run test
Steps to Reproduce
Run an independent test and notice that no test was matched.
Debug an independent test and notice that it matches the test and it works as expected.
The issue seems to be with testPathPattern
and the way it is escaped when running the test. testPathPattern
doesn't seem to be used when debugging the test.
See attached repro project - my-app.zip
Hi, thanks for the sample app, yes I can repro your issue on windows with npm 8.5. This is a known issue (see comment, npm/cli#3680, npm/exec#2). You can work around this issue by either downgrade npm to 6.x or switching to yarn.
for people who had problems with testPathPattern, i.e. npm miss-interpreting the pass-through arguments: it seems npm @>=8.15 has fixed this issue. 🎉