当我在本地运行yarn run coverage
时,我可以在终端中看到格式精美的报告,
yarn run coverage
yarn run v1.12.1
$ jest --env=jsdom --coverage
PASS src/containers/someclass.test.js
PASS src/containers/anotherclass.test.js
-------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
-------------------|----------|----------|----------|----------|-------------------|
All files | 20.26 | 15.96 | 23.08 | 20.6 | |
src/containers | 68.57 | 43.33 | 54.1 | 67.39 | |
someclass.test.js | 88.24 | 75 | 80 | 89.74 | 33,36,101,110 |
nextclass.test.js | 90 | 60 | 81.82 | 90 | 66,69 |
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 6.22s
当我的大厅管道作业使用相同的命令yarn run coverage
运行脚本时,它会提供以下内容
yarn run coverage
yarn run v1.12.3
$ jest --env=jsdom --coverage
PASS src/containers/someclass.test.js
PASS src/containers/nextclass.test.js
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | Unknown | Unknown | Unknown | Unknown | |
----------|----------|----------|----------|----------|-------------------|
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 7.41s
任何想法都会导致这种差异