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 config all:true does not work #194

Closed
penx opened this issue Apr 16, 2020 · 5 comments
Closed

nyc config all:true does not work #194

penx opened this issue Apr 16, 2020 · 5 comments
Assignees
Labels

Comments

@penx
Copy link

penx commented Apr 16, 2020

Versions

  • What is this plugin's version? 3.2.1
  • What is Cypress version? 4.4.0
  • What is your operating system? Mac OS X 10.15.4
  • What is the Node version? 12.14.1
  • What is the NPM version? 6.13.4

Describe the bug

If I have the following in my package.json:

  "nyc": {
    "report-dir": "coverage/integration",
    "all": true,
    "include": ["src/**/*.js"],
    "exclude": ["**/*.test.js", "**/*.stories.js"]
  }

Logs and screenshots
Screenshot 2020-04-16 at 17 23 59

Note that design-system coverage is 100% but hasn't included all files in this folder.

Link to the repo
https://github.com/penx/storybook-code-coverage

yarn
yarn coverage:integration
open coverage/integration/lcov-report/index.html

side note - is it possible to put the nyc config for cypress anywhere other than package.json? I am using nyc for multiple reports and would rather not store the cypress-specific config in a shared location. Just checking if this would be a feature request.

@bahmutov
Copy link
Contributor

Since we call nyc ourselves via its module API, we don't read all package nyc settings, let me add all here https://github.com/cypress-io/code-coverage/blob/master/task.js#L151

@bahmutov
Copy link
Contributor

🎉 This issue has been resolved in version 3.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@penx
Copy link
Author

penx commented Apr 21, 2020

@bahmutov I don't think this has worked:

I tried updating https://github.com/penx/storybook-code-coverage to 3.2.2, but I still don't get files that have 0% coverage appearing in the report.

I also tried 3.4.1 but get another error:

Error: ENOENT: no such file or directory, open '/Development/storybook-code-coverage/coverage/integration/coverage-final.json'

I removed "report-dir": "coverage/integration", from my package.json which fixed the ENOENT error, but still the report doesn't contain files with 0% coverage.

@bahmutov
Copy link
Contributor

Please re-open this issue after trying the latest plugin version v3.4.1 and running it with DEBUG=code-coverage variable to see the full list of messages

@penx
Copy link
Author

penx commented Apr 21, 2020

reopened as #206, thanks

rndmerle pushed a commit to rndmerle/code-coverage that referenced this issue Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants