Open loick opened 7 years ago
I've got the same issue when using karma instead of jest.
Stack: webpack@2.2.0.rc-3 karma@1.3.0 babel-istanbul@0.6.1
Same here.
Stack: webpack@2.2.0-rc.3 jest@17.0.2 istanbul@0.4.5 istanbul-reports@1.0.0 istanbul-api@1.1.0 babel-plugin-istanbul@2.0.3
Had the same issue, but only after I ran the yarn clean
. Removing .yarnclean file and reinstalling all modules fixed the issue.
Yes, that worked!
rm -rf node_modules .yarnclean && yarn
Why would istanbul need to write in the node_modules directory? That seems wrong.
@pelle It's trying to read the templates in node_modules. Maybe a better message would be "Failed to create coverage reports", because at that point it is not writing anything.
I like the solution @rlecaro2 suggested. FYI, his pattern didn't work for me. Instead I had to use:
# asset directories
!nyc/node_modules/istanbul-reports/lib/html/assets
Thanks!
Thanks @rlecaro2. For me the pattern was !istanbul/lib/assets
At the moment, an exception to two places should be added.
.yarnclean file:
# asset directories
docs
doc
website
images
assets
!istanbul-reports/lib/html/assets
!istanbul-api/node_modules/istanbul-reports/lib/html/assets
Remember to remove .yarnlock after this operation and reinstall dependencies.
rm -rf node_modules
yarn install
Yes, that worked!
rm -rf node_modules .yarnclean && yarn
The .yarnclean file is used to clean folders depending on the files you do not need, it is better is to control what should be removed, if you use istanbul-reports, you should add an exception to the .yarnclean file so that you do not delete the assets folder in this dependence.
[Bug]
Hi there, when I'm using the test-coverage of Jest (so basically Istanbul), I get this error stack:
I can see there are no file or directory named
assets
in the html folder, do you know why ?I'm using Jest v18.1.0. (and I can see in the changelog,
Updated istanbul-api.
, maybe it's related ? Since I don't have the issue with Jest v18.0.0)