简体   繁体   中英

How can I run Jest test in band with the VSCode extension?

I want to run the Jest tests in band, because otherwise they will cause errors.

But I have no clue how to solve that problem. It works everything fine when I run the tests with the command line.

In VSCode settings, change the Jest: Path to Jest to the command line you're running. For example:

npm test -- --runInBand

vscode设置截图

In new version of vscode jest.pathToJest is deprecated, instead you should set jest.jestCommandLine . You can either use the settings panel to set the value for the jestCommandLine . like this: 在此处输入图像描述

Or you can manually update the settings.json like this:

"jest.jestCommandLine": "\"./node_modules/.bin/jest\" --runInBand"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM