This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
Failed to write coverage reports: metrics.isEmpty is not a function. #291
Closed
Description
Is this a bug report?
Yes.
Can you also reproduce the problem with npm 4.x?
No.
Which terms did you search for in User Guide?
- istanbul
- metrics.isEmpty
- coverage
Environment
npm ls react-scripts-ts
(if you haven’t ejected): react-scripts-ts@2.14.0node -v
: v9.10.0npm -v
: 5.8.0yarn --version
(if you use Yarn): 1.3.2npm ls react-scripts-ts
(if you haven’t ejected): react-scripts-ts@2.14.0
Then, specify:
- Operating system: macOS Version 10.12 / Windows 10
Steps to Reproduce
- Install react-scripts-ts in version 2.14 (no issues in version 2.13)
- Run
npm run test
oryarn test
(runs jest with --coverage)
Expected Behavior
The tool writes the coverage report.
Actual Behavior
The tool doesn't write the coverage report.
Stacktrace below:
Failed to write coverage reports:
ERROR: TypeError: metrics.isEmpty is not a function
STACK: TypeError: metrics.isEmpty is not a function
at tableRow (/UserPath/ts-coverage-error/node_modules/istanbul-reports/lib/text/index.js:133:27)
at TextReport.onSummary (/UserPath/ts-coverage-error/node_modules/istanbul-reports/lib/text/index.js:188:15)
at TextReport.onDetail (/UserPath/ts-coverage-error/node_modules/istanbul-reports/lib/text/index.js:193:17)
at Visitor.(anonymous function) [as onDetail] (/UserPath/ts-coverage-error/node_modules/istanbul-lib-report/lib/tree.js:34:30)
at ReportNode.Node.visit (/UserPath/ts-coverage-error/node_modules/istanbul-lib-report/lib/tree.js:123:17)
at /UserPath/ts-coverage-error/node_modules/istanbul-lib-report/lib/tree.js:116:23
at Array.forEach (<anonymous>)
at visitChildren (/UserPath/ts-coverage-error/node_modules/istanbul-lib-report/lib/tree.js:115:32)
at ReportNode.Node.visit (/UserPath/ts-coverage-error/node_modules/istanbul-lib-report/lib/tree.js:126:5)
at /UserPath/ts-coverage-error/node_modules/istanbul-lib-report/lib/tree.js:116:23
Reproducible Demo
- clone the project
- run
yarn
- run
yarn test
/npm run test
If I delete my node_modules rm -rf node_modules
then run npm install
and npm test
/yarn test
it works. (at least on my computer, couldn't reproduce this in my CI.)
And if I downgrade to react-scripts-ts
2.13.0
and re-run yarn
+ yarn test
there's also no metrics.isEmpty is not a function
error.
Hope you can reproduce this issue and find out why it happens. I find it really weird!
Metadata
Metadata
Assignees
Labels
No labels