gpt4 book ai didi

continuous-integration - TeamCity 上的 Jest 测试

转载 作者:行者123 更新时间:2023-12-04 02:52:00 25 4
gpt4 key购买 nike

我有一个使用 Jest 和 jest-teamcity-reporter 作为 testResultsProcessor 的 React 应用程序 enter image description here

我的 npm 测试脚本如下: enter image description here

问题是当我在包含测试覆盖率的团队城市中运行我的构建时,测试正在运行但我看不到结果中的测试选项卡以及通过的测试数量。 enter image description here在日志中我有以下错误: enter image description here

请注意,我有其他项目使用相同的模板,我在查看测试选项卡和指标时没有问题 enter image description here

最后这是我在模板中定义的构建步骤 enter image description here

你能帮我解决这个问题吗

谢谢。

最佳答案

您必须在 package.json 中的 jest 配置对象中添加测试结果处理器。

"testResultsProcessor": "jest-teamcity-reporter"

要在本地测试,您需要在命令行中设置一个变量:SET TEAMCITY_VERSION=1

您将看到以 ##teamcity 开头的日志行,这就是您要查找的指标。

关于continuous-integration - TeamCity 上的 Jest 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54646984/

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