如何依次运行Jest测试? [英] How to run Jest tests sequentially?
本文介绍了如何依次运行Jest测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在通过npm test
运行Jest测试. Jest默认情况下并行运行测试.有什么方法可以使测试按顺序运行?
I'm running Jest tests via npm test
. Jest runs tests in parallel by default. Is there any way to make the tests run sequentially?
我有一些测试调用依赖于更改当前工作目录的第三方代码.
I have some tests calling third-party code that relies on changing the current working directory.
推荐答案
CLI选项未记录,但可通过运行命令jest --help
进行访问.
CLI options are not documented but accessible by running the command jest --help
.
然后,您将看到所需的选项:--runInBand
.
Then, you'll see the option you are looking for : --runInBand
.
这篇关于如何依次运行Jest测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文