You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.
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 or yarn 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
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-ts2.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!
The text was updated successfully, but these errors were encountered:
panmona
changed the title
Failed to write coverage reports: metrics.isEmpty is not a function. React-Scripts-Ts 2.14
Failed to write coverage reports: metrics.isEmpty is not a function.
Mar 28, 2018
This seems to be caused by the same issue as described here: jestjs/jest#5772
For now, you might just upgrade ts-jest to a more recent version - your yarn.lock mentions 22.0.1, and the most recent is 22.4.2. I can confirm that this error no longer raises after updating.
Just note that it might be required to delete the lock file and generate it again - yarn sometimes behaves curious in terms of transitive depedencies.
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?
Environment
npm ls react-scripts-ts
(if you haven’t ejected): [email protected]node -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): [email protected]Then, specify:
Steps to Reproduce
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:
Reproducible Demo
Demo Project
yarn
yarn test
/npm run test
If I delete my node_modules
rm -rf node_modules
then runnpm install
andnpm 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-runyarn
+yarn test
there's also nometrics.isEmpty is not a function
error.Hope you can reproduce this issue and find out why it happens. I find it really weird!
The text was updated successfully, but these errors were encountered: