TeamCity上有测试

问题描述 投票:2回答:1

我有一个反应应用程序使用Jest和jest-teamcity-reporter作为testResultsProcessor 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中定义的构建步骤

你能帮我解决这个问题吗?

谢谢。

continuous-integration teamcity jestjs test-coverage
1个回答
4
投票

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

"testResultsProcessor": "jest-teamcity-reporter"

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

您将看到以##teamcity开头的日志行,这是您正在寻找的指标。

© www.soinside.com 2019 - 2024. All rights reserved.