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

Debug Jest Tests recipe fails on Mac #321

Open
David-Rickard opened this issue May 13, 2022 · 1 comment
Open

Debug Jest Tests recipe fails on Mac #321

David-Rickard opened this issue May 13, 2022 · 1 comment

Comments

@David-Rickard
Copy link

David-Rickard commented May 13, 2022

https://github.com/Microsoft/vscode-recipes/tree/main/debugging-jest-tests
@jagreehal

When running on MacOS, it fails with this error:

Uncaught SyntaxError /Users/david/Projects/app-dasher-onboarding/node_modules/.bin/jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1032:15)
    at Module._compile (node:internal/modules/cjs/loader:1067:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:822:12)
    at executeUserEntryPoint (node:internal/modules/run_main:77:12)
    at <anonymous> (node:internal/main/run_main_module:17:47)

It's fixed if I use this setting from the Windows config:

"program": "${workspaceFolder}/node_modules/jest/bin/jest"

I'm wondering if it's because I'm running on an M1 chip.

This is also failing in the same way when I try to debug an individual test using the Jest VSCode extension.

@David-Rickard
Copy link
Author

Actually I think it might be using the pnpm package manager that is requiring the alternate config. This launch config works as well: https://gist.github.com/esamattis/600d6964f3e6ab6e8e7da9a05bfe6574

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

No branches or pull requests

1 participant