nyc报告未在TravisCI版本中上传到Codecov

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

我已将codecov配置到我的NodeJS应用程序。

当我运行npm run codecov --disable=gcov时,它将生成报告,并且可以看到结果。但是在我的TravisCI版本中,我在日志中收到一条消息,内容为

X无法读取文件

==> Scanning for reports
    X Failed to read file at 

这是我的package.json的样子。

"report-coverage": "nyc report --reporter=text-lcov --recursive \"./spec/**/*.spec.js\" > coverage.lcov && codecov",
"coverage": "codecov --disable=gcov"

这里是package.json

这里是TravisCI build log的链接。

javascript node.js travis-ci nyc codecov
1个回答
0
投票

是因为我没有在npm run test之前运行npm run coverage

因此,我已按照以下方式更改了travis.yml中的after_success:

after_success: npm run test && npm run coverage
© www.soinside.com 2019 - 2024. All rights reserved.