firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

Support quotes or injection of parameters in "jestrunner.jestCommand" #247

Open petr-nazarov-yoobic opened 2 years ago

petr-nazarov-yoobic commented 2 years ago

Example: I need to run a command like this:

doppler run  --command  "node 'node_modules/.bin/jest'   '<PATH_TO_TEST_FILE>' -c 'PATH_TO_JS_CONFIG' -t 'Testing Repository should create an entity'"

so that the jest command is inside double-quotes.

The best way I came up with is in settings.json put:

"jestrunner.jestCommand": "doppler run  --command  \"node 'node_modules/.bin/jest'"

but this requires to additionally close the dquote> to run the command.

It would be amazing if a jestrunner.jestCommand would support a syntax. like so:

"jestrunner.jestCommand": "doppler run  --command  \"node 'node_modules/.bin/jest' ${JEST_COMMAND_PARAMETERS} \""

Where:

JEST_COMMAND_PARAMETERS =  '<PATH_TO_TEST_FILE>' -c 'PATH_TO_JS_CONFIG' -t 'Testing Repository should create an entity'