vscode-jest
vscode-jest copied to clipboard
Extension does not work with `nushell` on macOS
Environment
-
vscode-jest version
: v5.2.3 -
node -v
: v18.17.1 -
npm -v
oryarn --version
: 9.6.7 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected):@discord-plays-pokemon/[email protected] /Users/jerred/git/discord-plays-pokemon └─┬ @discord-plays-pokemon/[email protected] -> ./packages/backend └─┬ [email protected] └── [email protected]
- your vscode-jest settings if customized:
"jest.jestCommandLine": "/Users/jerred/.local/share/rtx/installs/node/18.17.1/bin/npx jest", "jest.nodeEnv": { "node": "/Users/jerred/.local/share/rtx/installs/node/18.17.1/bin/node" }, "jest.rootPath": "packages/backend/", "jest.shell": "/opt/homebrew/bin/nu"
- Operating system: macOS Sonoma 14.0
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 run test
ornpx jest
Steps to Reproduce
Install nushell and configure Jest to use it
Relevant Debug Info
looks like the extension encountered some shell env issues so it is trying to fall back to a login shell (hoping to resolve the env initialization errors.). There are a list of common shells the extension could auto-fallback to login-shell, but nushell
is not one of them (see here)
To make a long story short, if this only happens occasionally, you can try to restart vscode or start vscode from a macOS terminal. If it happens often and you don't mind using login shell for running jest, you can try to set your shell to login shell:
for example, if nushell
uses --login
as the login shell flag:
"jest.shell": {
"path": "/opt/homebrew/bin/nu"
"args": ["--login"],
}
Let me know if that works.
Thank you for getting back to me, @connectdotz
In the end I switched back to fish
because I ran into too many problems with nushell
. I do appreciate you looking into this issue.