I have some sets of Jest test cases that run Puppeteer browser tests.
I have tried these test runners
To me, I like Jest Test Explorer the most but it always auto-start running test cases. As you can imagine, a lot of Chrome browser instances get launched when I open a project with VS Code.
I found some configurations but they cannot prevent auto-run test cases.
"testExplorer.onStart": "reset"
, or set to null"testExplorer.onReload": "reset"
, or set to nullFYI, an example UI of Jest Test Explorer
Jest (vscode-jest
) is a good runner but I can't stop auto-run with these settings as well.
"jest.runAllTestsFirst": false,
"jest.autoEnable": false,
"jest.showCoverageOnLoad": false
Therefore, right now Jest Runner (vscode-jest-runner) is the only runner that does not auto-start unit tests.
In addition, if you have any other test runners to suggest, please let me know.
Thank you so much.
By default, Jest runs all your tests and shows their result in the console. Yet, Jest comes with a bail option allowing you to stop running tests after n failed tests. You may configure the bail option to a boolean value or a number. Using a boolean for bail will either stop or not stop after the first failed test.
vscode-jest-runner is focused on running or debugging a specific test or test-suite, while vscode-jest is running your current test-suite everytime you change it. Simple way to run or debug a specific test As it is possible in IntelliJ / Webstorm Jest Runner will work out of the box, with a valid Jest config.
Help debug jest tests in vscode. Supports multiple test run modes (automated, manual, and hybrid onSave) to meet user's preferred development experience. Simply open Jest - Visual Studio Marketplace and click "Install". Alternatively open Visual Studio Code, go to the extension view and search for "Jest".
If you have a more sophisticated project configuration or prefer to run tests differently, fear not, the extension supports extensive customization settings. For example: you can use jest.jestCommandLine to tell the extension to use yarn test instead of the default jest command.
You can write and run unit tests in Visual Studio using some of the more popular JavaScript frameworks without the need to switch to a command prompt. Both Node.js and ASP.NET Core projects are supported. The supported frameworks are: Mocha (mochajs.org) Jasmine (Jasmine.github.io) Tape (github.com/substack/tape) Jest (jestjs.io)
I made it work by only setting the setting "jest.autoEnable": false,
on my settings.json
and restarting VSCode. At least, it is working until now and it hasn't broken yet: Disable starting Jest automatically
To open your settings.json
:
Preferences: Open Settings (JSON)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With