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

pnpm run test -- is not handled as a package script when specified in jestCommandLine #974

Open
ermik opened this issue Dec 23, 2022 · 2 comments · May be fixed by #1046
Open

pnpm run test -- is not handled as a package script when specified in jestCommandLine #974

ermik opened this issue Dec 23, 2022 · 2 comments · May be fixed by #1046

Comments

@ermik
Copy link

ermik commented Dec 23, 2022

Environment

Jest 29 & PNPM 7

Prerequisite

  • are you able to run jest test from the command line? yes
  • how do you run your tests from the command line? pnpm run test

Steps to Reproduce

Set jestCommandLine to pnpm run test -- and use the debug test workflow.

Expected Behavior

The package script will be correctly delegated to for jest binary invocation.

Actual Behavior

The invocation will show node invoking the specified string expecting it to be a path to a module:

[...] /usr/local/bin/node ./pnpm run test

causing "Cannot find module" error. This works with npm run test because usage of a "magic string" (npm) changes the debug invocation to refer to the package manager instead of the local node binary.

@connectdotz
Copy link
Collaborator

That's true, want to work on a PR? should be pretty straightforward:

private usePM(cmd: string, args: string[]): Partial<vscode.DebugConfiguration | undefined> {

@ermik
Copy link
Author

ermik commented Dec 26, 2022

Thanks for asking, I might. Will post here if I pick this up. 💟

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