Closed yegorpetrov closed 9 months ago
This looked like a bug, but I can't repro in any of my test projects... Do you have a sample repo we can take a look at?
Otherwise, we have to dig into it manually:
jest.rootPath
setting? @connectdotz
Do you have a sample repo we can take a look at?
npm i
in backend/src/nodejstestPathPattern
is incorrectOtherwise, we have to dig into it manually
I will answer regardless.
- Do you happen to have a jest.rootPathsetting?
Nope.
- Do you open vscode project workspace from the "backend" folder?
Yes.
- Just to confirm that restarting vscode didn't make any difference?
Nope.
- Are you able to use the test file editor's gutter menu to run tests?
Yes, even in 6.2.0 I can run individual tests from the editor and in that case testPathPattern
is correct and points to the file with all path segments in place. The issue is being unable to run on directories, except may be the root directory.
- Any other jest settings we should know about?
No. I left as much as I could from the problematic project in the repro so you can check. I don't see any relevant OS user settings for jest.
If you need a sample repo I am experiencing this bug in the following repo: https://github.com/immich-app/immich/
Using v6.2.0 I want to run the spec.ts tests in the server/ folder. I set the Jest configuration to the following:
I am not using a monorepo setup in vscode-jest even though the repo is a monorepo
I am able to run individual test files (like the activity folder in the below screenshot) from the test panel in vscode, but when I move to running all tests, it removes the server/ folder from the testPathPattern argument, resulting in no tests.
Can confirm that rolling back to 5.2.3 fixes the issue.
On 5.2.3: jest --testLocationInResults --json --useStderr --outputFile /tmp/jest_runner_immich_1000_2.json --no-coverage --reporters default --reporters /home/etnoy/.vscode-server/extensions/orta.vscode-jest-5.2.3/out/reporter.js --colors --watchAll=false --testPathPattern /home/etnoy/code/immich/server/src
On 6.2.0: jest --testLocationInResults --json --useStderr --outputFile /tmp/jest_runner_immich_1000_2.json --no-coverage --reporters default --reporters /home/etnoy/.vscode-server/extensions/orta.vscode-jest-6.2.0/out/reporter.js --colors --watchAll=false --testPathPattern /home/etnoy/code/immich/src
note that the testPatPattern is incorrect on 6.2.0
Thanks for the sample repo! It helped me to locate and fix the issue in v6.2.1.
Please don't hesitate to let me know if there are any other issues.
Thanks, 6.2.1 fixed the issue for me :)
I too, can confirm it was fixed.
Environment
vscode-jest version
: 6.2.0node -v
: v20.9.0npm -v
: 10.1.0npm ls jest
:Prerequisite
npm run unit-ci
Steps to Reproduce
Upgrade to 6.2.0
Expected Behavior
Ability to run tests at any level of the tests tree view
Actual Behavior
Unable to run tests at many levels of the tests tree view. In the "Test results" panel it looks like the extension is omitting path segments for no apparent reason. In comparison with v.5.2.3, the tree view is also missing those segments. The typical output is as follows:
The correct path is \backend\src\nodejs\handlers\store. If I copy the command (as shown on screenshots) and run it manualy with a fixed path, then it works.