jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.84k stars 293 forks source link

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

Open ermik opened 1 year ago

ermik commented 1 year ago

Environment

Jest 29 & PNPM 7

Prerequisite

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 commented 1 year ago

That's true, want to work on a PR? should be pretty straightforward: https://github.com/jest-community/vscode-jest/blob/3deb1af4586aaf6baf2ae30cdced34e77575a436/src/DebugConfigurationProvider.ts#L157

ermik commented 1 year ago

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