Skip to content
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

No test found by running the test with the ui on a single file on Windows #1017

Open
florianzemma opened this issue Apr 5, 2023 · 1 comment

Comments

@florianzemma
Copy link

florianzemma commented Apr 5, 2023

Environment

  1. vscode-jest version: [5.2.3]
  2. node -v: [v16.13.2]
  3. npm -v : [8.1.2]
  4. your vscode-jest settings if customized:
    • jest.jestCommandLine? [npm run test:dev --]
  5. Operating system: [Windows 11 ]

Prerequisite

  • are you able to run jest test from the command line? Yes work fine with command line
  • how do you run your tests from the command line? npm run test:dev [filename]

Relevant Debug Info

I can run all the tests using the UI and with command line with no problem.

I can't run test one by one by clicking the red or green arrow directly on the file this result to 'No test found error'

In C:\Users\Florian\Desktop\Apps\crm-ui
2570 files checked.
testMatch: /tests//.[jt]s?(x), **/?(.)+(spec|test).[tj]s?(x) - 328 matches
testPathIgnorePatterns: C:\Users\Florian\Desktop\Apps\crm-ui\dist\, C:\Users\Florian\Desktop\Apps\crm-ui\node_modules\, C:\Users\Florian\Desktop\Apps\crm-ui\src\config\test.ts - 2570 matches
testRegex: - 0 matches
Pattern: c:\\Users\\Florian\\Desktop\\Apps\\crm-ui\\src\\features\\offerComposition\\components\\tests\\ServiceDetailsBanner\.test\.tsx - 0 matches

But It's working when I run npm run test:dev ServiceDetailsBanner.test.tsx

Expected Behavior

Run the test when i click on the red or green arrow on a single file

Actual Behavior

No test found when I run the test by clicking on the green or red arrow on a test file


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...

@connectdotz
Copy link
Collaborator

This could be related to a known npm bug with TestPathPattern on windows when using the UI to run an explicit test (#838). Please see comment for the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants