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

[bug] vscode jestCommandLine windows path incompatibility #70

Closed
jrson83 opened this issue Sep 20, 2023 · 0 comments · Fixed by #71
Closed

[bug] vscode jestCommandLine windows path incompatibility #70

jrson83 opened this issue Sep 20, 2023 · 0 comments · Fixed by #71
Assignees

Comments

@jrson83
Copy link
Collaborator

jrson83 commented Sep 20, 2023

Describe the bug

//.vscode/settings.json
"jest.jestCommandLine": "node_modules/.bin/jest",

The slash / is incompatible on Windows. When launching vscode Jest process throws an error:

The command "node_modules" is either misspelled or
could not be found.

[error] failed to retrieve test file list. TestExplorer might show incomplete test items

Jest process "watch-tests" ended unexpectedly
- Source: Jest (Extension)

Fix

Changing slash / to \\ will work for Windows, but the issue will instead occour on Linux/MAC.

Fix for the issue, to work on all platforms (tested on Windows & MAC):

"jest.jestCommandLine": "npx jest",

Reproduction

On a Windows terminal/cmd:

  1. Clone the repo
  2. run pnpm install
  3. launche code .
  4. Install all recommended extensions
  5. Restart vscode
  6. It should throw the error

Environment

  • OS with version: Windows 11
  • Browser with version: Firefox 117.0
  • JS Runtime with version: NodeJS v20.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant