Tag: code climate

Jest JStesting覆盖率数据不会从Codeship发布到代码气候

我有一个基于Node.js的项目,我正在使用Jest进行.jsunit testing。 我将collectCoverageconfiguration设置设置为true并可以在本地开发运行中查看testing覆盖表,以及何时在Codeship中运行构build。 但是,我似乎无法得到testing覆盖率数据在Code Climate中显示的结果。 我将CodeClimate的设置说明中给出的回购令牌保存到Codeship环境variables中,如下所示: CODECLIMATE_REPO_TOKEN=xxxxxxxxxx codeclimate-test-reporter < lcov.info 鉴于在本地,JEST collectCoverage将lcov.info数据文件保存在我的项目根目录下的一个名为coverage的目录中,我也尝试过使用该path的环境variables的变体,例如: CODECLIMATE_REPO_TOKEN=xxxxxxxxxx codeclimate-test-reporter < coverage/lcov.info 对于codeclimate-test-reporter节点模块( npm install -g codeclimate-test-reporter )的npm install -g codeclimate-test-reporter ,我不清楚它应该到哪里去。 我试过把它: 在通用npm install命令之前的Codeshiptesting设置设置命令部分, 在Codeshiptestingpipe道configuration命令部分中, 我也试过在我的package.json中将其作为本地开发依赖项进行安装。 上述尝试结合起来,导致在Code Climate方面看到有关testing覆盖率的任何内容。 作为我所做的最后一点,我没有提交我的本地coverage目录,所以它不包含在我的Codeship版本中。 任何人都可以帮我弄清楚我做错了什么?