gpt4 book ai didi

angular - 如果任何一项测试失败,如何停止 Jasmine 单元测试

转载 作者:太空狗 更新时间:2023-10-29 19:33:33 25 4
gpt4 key购买 nike

我写了 500 多个单元测试方法。当我给出 ng test 命令时。它开始测试所有 500 种方法。

如果任何测试用例失败,它不会停止并继续执行所有方法。所以我需要等待更多时间再次重新运行单元测试。

我知道我们可以通过执行 ctr+c 来存在,然后使用 ng test 命令再次运行单元测试。这种方式也太花时间了。

如果任何一个测试失败,是否有可能停止(不存在)单元测试?

最佳答案

如果要从所有测试用例中排除该文件。尝试在 cli 配置文件中添加排除部分。

src/tsconfig.app.json: 

此处显示:

{
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016",
"dom"
],
"outDir": "../out-tsc/app",
"target": "es5",
"module": "es2015",
"baseUrl": "",
"types": []
},
"exclude": [
"test.ts",
"filename.spec.ts"
]
}

关于angular - 如果任何一项测试失败,如何停止 Jasmine 单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48700673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com