You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode中Jest配置文件设置testTimeout和verbose无效,命令行执行却正常的问题求助

VSCode中Jest配置文件设置testTimeout和verbose无效,命令行执行却正常的问题求助

大家好,我最近在配置Jest的时候碰到了一个棘手的问题,想请教下有没有朋友能帮忙解答下~

我直接在命令行执行jest --testTimeout 10000 --verbose时,所有测试都能正常运行,超时时间和详细日志的设置都能生效。但当我把这些配置写到jest.config.js配置文件里后,在VSCode中运行测试就完全没效果:测试会因为超时失败,而且VSCode的输出面板还会弹出配置项未知的警告。

我的jest.config.js配置内容如下:

module.exports = {
  verbose: true,
  testTimeout: 10000,
};

VSCode输出面板里的警告信息是:

● Validation Warning:
Unknown option "verbose" with value true was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration

● Validation Warning:
Unknown option "testTimeout" with value 10000 was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration

我在GitHub上找到了一个类似的Bug,但一直没有后续处理。实在不知道该怎么办了,有没有大佬能给点思路呀?

备注:内容来源于stack exchange,提问作者Aditya Guru

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 15:14:34