nyc: Windows causes coverage to be 0%
Link to bug demonstration repository.
https://github.com/michaelKurowski/lokim2/tree/nyc-issue-branch
Expected Behavior
npm i
in the main directorygulp prepareDev
- put some mongodb credentials into
src/server/config.json
(mlab provides free ones, I can also send credentials to a free instance created there) gulp serverTestCoverage
- I should see a table with files covered with realistic results. Something like that: https://gist.github.com/michaelKurowski/09e493010cfe6ac5faa0c823f4605845
Observed Behavior
Everything works flawlessly on Linux, but on Windows I get a corrupted report: https://gist.github.com/michaelKurowski/a562595264d935b22d57f79daeaeefb6
Forensic Information
Operating System: Observed on Windows 7 and 10 Environment Information: https://gist.github.com/michaelKurowski/01980c68ac8916605b36292f33f77504
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (5 by maintainers)
Issue has been solved. I’ve had to run mocha directly in
gulp serverTest
instead of usingnpx
@calebcartwright OP has experienced the issue with nyc@11. If you are only experiencing the issue with nyc@14 then it’s definitely a different issue, even if it has some of the same symptoms.
@calebcartwright you are experiencing a different issue than OP. Your issue (I suspect) is that nyc@14 enables
--exclude-after-remap
which means that we look at the source-maps to determine the original filename and process include, exclude, and extension matching to determine what should/shouldn’t be reported.Everybody: please do not comment here unless you are experiencing the exact issue @michaelKurowski reported - flawless coverage under Linux but not Windows. For everything else please post a new issue including all required information.
Having the same issue here. On Win10 w/ Git Bash, I get:
When I run the same command on Ubuntu Bash:
node -v => v10.15.3 Using only yarn to run tests (
yarn test
). Relevant package.json :