最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I run Jest test in band with the VSCode extension? - Stack Overflow

programmeradmin1浏览0评论

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 mand line.

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 mand line.

Share Improve this question edited Mar 12, 2020 at 20:37 skyboyer 23.8k7 gold badges62 silver badges71 bronze badges asked Mar 8, 2020 at 21:24 Michael MaroltMichael Marolt 612 silver badges8 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

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

npm test -- --runInBand

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"

Another simple solution is

"jest.jestCommandLine": "npx jest"
发布评论

评论列表(0)

  1. 暂无评论