Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] Extension incompatible with non FHS systems (e.g. NIXOS) #1205

Open
sysarcher opened this issue Dec 3, 2024 · 1 comment
Open

[BUG] Extension incompatible with non FHS systems (e.g. NIXOS) #1205

sysarcher opened this issue Dec 3, 2024 · 1 comment

Comments

@sysarcher
Copy link

sysarcher commented Dec 3, 2024

Describe the bug
On systems that don't follow Linux FHS (e.g. nixos), the jest extension fails to find /bin/bash. It is better to use /usr/bin/env bash in shebang scripts and code so that the correct interpreter is automatically selected.

To Reproduce
Steps to reproduce the behavior: (ON NIXOS)

  1. Go to any test
  2. Click on 'RUN'
  3. See error

Note: A sample repo will help us identify the bug much faster. 🙏

Expected behavior
Tests are run similar to other distros

Screenshots
If applicable, add screenshots to help explain your problem.
Image

Environment (please complete the following information):

  • vscode-jest version: v6.4.0
  • node -v: 22.10.0
  • npm -v: 10.9.0
  • Operating system: nixos-unstable

Prerequisite

  • are you able to run jest from the command line? YES
  • where do you run jest CLI from? Project and workspace root
  • how do you run your tests from the command line? npm run test

Additional context
Seems to be an issue with FHS because there's no /bin/bash in nixos.

$ npm config list                                                               [14:50:30]
; node bin location = /nix/store/2p8ilfl32xmhz49qghsayprxc001n2yv-nodejs-22.10.0/bin/node
; node version = v22.10.0
; npm local prefix = # masked
; npm version = 10.9.0
; cwd = # masked
; HOME = /home/sysarcher
; Run `npm config ls -l` to show all defaults.
$ npm config list -l
...
shell = "/run/current-system/sw/bin/zsh"
...
# settings.json
...
"jest.shell": "/usr/bin/env bash",
...

maybe related: #883

The fastest (and the most fun) way to resolve the issue is to submit a pull request yourself. If you are interested, please check out the contribution guide, we look forward to seeing your PR...

@sysarcher sysarcher changed the title [BUG] [BUG] Extension incompatible with non FHS systems (e.g. NIXOS) Dec 3, 2024
@sysarcher
Copy link
Author

Temporary fix is to:

"jest.shell": "/run/current-system/sw/bin/zsh"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant