Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nyc coverage report error on creation #371

Closed
GDunne96 opened this issue Apr 17, 2019 · 1 comment
Closed

nyc coverage report error on creation #371

GDunne96 opened this issue Apr 17, 2019 · 1 comment

Comments

@GDunne96
Copy link

Hi

I'm currently running nyc --reporter=lcov --reporter=text-lcov npm test to produce a coverage report. However, on the tests finishing and the creation of the coverage report the following error is given -

/node_modules/nyc/index.js:440
if (parentInfo.children.indexOf(info.uuid) === -1) {
^

TypeError: Cannot read property 'children' of undefined
at infos.forEach.info (/node_modules/nyc/index.js:440:22)
at Array.forEach ()
at NYC.writeProcessIndex (/node_modules/nyc/index.js:437:9)
at /node_modules/nyc/bin/nyc.js:68:9
at ChildProcess. (/node_modules/foreground-child/index.js:52:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

I've tried uninstalling and reinstalling nyc and tried other coverage reports e.g. clover etc but the problem still exists.

Thanks

@coreyfarrell
Copy link
Member

This was reported at istanbuljs/nyc#1067. The fix has been merged to nyc but not yet released (will be released in nyc@14.1.0).

Without seeing your repo I can only assume that your npm test also runs nyc. My advice is to avoid recursively running nyc as this is largely untested. Assuming npm test runs tests under nyc I recommend rewriting your above command to npm test && nyc report --reporter=lcov --reporter-text-lcov.

rofe added a commit to adobe/helix-pipeline that referenced this issue Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants