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

Extension does not work with nushell on macOS #1067

Open
shepherdjerred opened this issue Sep 15, 2023 · 1 comment
Open

Extension does not work with nushell on macOS #1067

shepherdjerred opened this issue Sep 15, 2023 · 1 comment

Comments

@shepherdjerred
Copy link

Environment

  1. vscode-jest version: v5.2.3
  2. node -v: v18.17.1
  3. npm -v or yarn --version: 9.6.7
  4. npm ls jest or npm 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]
    
  5. 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"
    
  6. 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 or node_modules/.bin/jest) npm run test or npx jest

Steps to Reproduce

Install nushell and configure Jest to use it

Relevant Debug Info

CleanShot 2023-09-15 at 13 19 10@2x

@connectdotz
Copy link
Collaborator

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.

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