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

Jest-Runner is not passing 'runOptions' to Jest #214

Open Lutier2017 opened 3 years ago

Lutier2017 commented 3 years ago

Hi, I am using:

Following your indication in the web page: https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner

Then, I included the following line in my project "package.json" file:

"jestrunner.runOptions": [ "--coverage", "--colors" ],

BUT, no coverage report is generated.

When I CLICK the pop-up menu option : "Run Jest", Jest-Runner executes the following command line to run the test:

node "d:/myProject/node_modules/jest/bin/jest.js" "d:/myProject/__test__/file.spect.js"

then no coverage report is generated.

It was expected that Jest-Runner executes the following command line instead:

node "d:/myProject/node_modules/jest/bin/jest.js" --coverage --color "d:/myProject/__test__/file.spect.js"

I noticed that If I run manually the above command, the test is executed successfully, and the coverage report is generated successfully as well.

I appreciate assistance to solve above problem, In order to automatically generate coverage report when I CLICK the pop-up menu option : "Run Jest".