vscode-jest-runner icon indicating copy to clipboard operation
vscode-jest-runner copied to clipboard

Setting "Jest Command" is ignored for Debug

Open westonNexben opened this issue 2 years ago • 4 comments

The setting works for non-Debug.

"node_modules/jest/bin/jest.js" is always run instead when trying to Debug.

westonNexben avatar Nov 22 '22 00:11 westonNexben

I have the same issue.

bigman73 avatar Jan 04 '23 14:01 bigman73

same issue here - any thoughts on how to fix this?

ysoussov avatar Jan 24 '23 18:01 ysoussov

@westonNexben jest command is ignored because 'node' is used as executable: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_launch-configuration-support-for-npm-and-other-tools

It is possible to override arguments by defining runtimeArgs and args inside debugOptions, for example:

"jestrunner.debugOptions": {
    "args": ["--no-cache"],
    "runtimeArgs": [
      "-r", "tsconfig-paths/register"
    ]
}

anasanzari avatar May 17 '23 13:05 anasanzari

Currently, jestrunner.jestCommand is not used in debug 👍

I think the closest equivalent is runtimeExecutable, which can be configured like this (see also CRA example in the readme):

"jestrunner.debugOptions": {
    "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
}

Does it solve the use cases if runtimeExecutable is set to the same value as jestrunner.jestCommand?

Also the debug button is a launch configuration, the options are documented here: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_launch-configuration-attributes

domsleee avatar Oct 15 '23 04:10 domsleee