question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nyc 15 gives no coverage without the useSpawnWrap option

See original GitHub issue

Link to bug demonstration repository

https://github.com/adjerbetian/nyc-bug-demo-use-spawn

Expected Behavior

I would want to have the coverage, but I get nothing in the output

image

I tried to debug, and when I use the flag --use-spawn-wrap I get the expected result:

image

📝 This problem does not occur on nyc@14.

Observed Behavior

Troubleshooting steps

  • run npx nyc mocha --> ❌ no coverage
  • run npx nyc --use-spawn-wrap mocha --> ✔️ coverage
  • still occurring when I put cache: false in my nyc config

Environment Information

  System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 10.25 GB / 31.07 GB
  Binaries:
    Node: 12.16.1 - /usr/bin/node
    npm: 6.14.4 - /usr/bin/npm
  npmPackages:
    nyc: ^15.0.1 => 15.0.1 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
coreyfarrellcommented, Apr 15, 2020

Thanks for the update. This is odd as I’m not seeing the issue using 12.16.1 on Fedora either. Without being able to reproduce I think we can close this issue, if you do ever see it again please be sure to post a new issue!

0reactions
coreyfarrellcommented, Apr 21, 2020

Worker threads are not supported by spawn-wrap at all. node-preload is the replacement, if it is failing in a case where spawn-wrap worked I need to see a reproducible demo suit can be fixed. Be aware spawn-wrap fails in many situations, especially on Windows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nyc 15 gives no coverage without the useSpawnWrap option ...
My desktop is Windows 10 10.0.19041.208, and the node.js environment is: node.js: 12.16.2, installed by nvs; npm: 6.14.4. The reproduce steps:.
Read more >
node.js - No coverage nyc mocha - Stack Overflow
There is an issue with the nyc (Instanbul) loader for ESM modules. The recommended solution is to abandon nyc and use the native...
Read more >
nyc | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
@cypress/code-coverage - npm Package Health Analysis | Snyk
Saves the code coverage collected during Cypress tests For more information about how to use this package see README. Latest version published 7...
Read more >
Code coverage in 2 minutes with NYC - DEV Community ‍ ‍
NYC is an npm package for getting stats about the test coverage working ... NYC to read the results from Mocha and it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found