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

excludeAfterRemap set to true makes the reports empty #217

Closed
thibleroy opened this issue Apr 27, 2020 · 4 comments · Fixed by #218
Closed

excludeAfterRemap set to true makes the reports empty #217

thibleroy opened this issue Apr 27, 2020 · 4 comments · Fixed by #218
Labels
released topic: empty output Cypress generates empty output reports typescript

Comments

@thibleroy
Copy link

Logs and screenshots

 code-coverage parsed sent coverage +2s
  code-coverage wrote coverage file C:\Users\thibl\dev\SpotiFine\e2e\.nyc_output\out.json +6ms
  code-coverage NYC file C:\Users\thibl\dev\SpotiFine\e2e\.nyc_output\out.json has 39 key(s) +0ms
  code-coverage 1 key C:\Users\thibl\dev\SpotiFine\front\spotifine\src\zone-flags.ts file path C:\Users\thibl\dev\SpotiFine\front\spotifine\src\zone-flags.ts +1ms
  code-coverage 2 key C:\Users\thibl\dev\SpotiFine\front\spotifine\src\polyfills.ts file path C:\Users\thibl\dev\SpotiFine\front\spotifine\src\polyfills.ts +0ms
  code-coverage 3 key C:\Users\thibl\dev\SpotiFine\front\spotifine\src\environments\environment.ts file path C:\Users\thibl\dev\SpotiFine\front\spotifine\src\environments\environment.ts +0ms
  code-coverage in file C:\Users\thibl\dev\SpotiFine\e2e\.nyc_output\out.json all files are not found? false +3ms
  code-coverage NYC file C:\Users\thibl\dev\SpotiFine\e2e\.nyc_output\out.json has 39 key(s) +3ms
  code-coverage combined NYC options { 'report-dir': './coverage', reporter: [ 'lcov', 'clover', 'json' ], extension: [ '.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx' ], excludeAfterRemap: true } +7ms
  code-coverage calling NYC reporter with options { 'report-dir': 'C:\\Users\\thibl\\dev\\SpotiFine\\e2e\\coverage', reporter: [ 'lcov', 'clover', 'json' ], extension: [ '.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx' ], excludeAfterRe
map: true, tempDir: 'C:\\Users\\thibl\\dev\\SpotiFine\\e2e\\.nyc_output', reportDir: 'C:\\Users\\thibl\\dev\\SpotiFine\\e2e\\coverage' } +69ms
  code-coverage current working directory is C:\Users\thibl\dev\SpotiFine\e2e +1ms
  code-coverage after reporting, returning the report folder name C:\Users\thibl\dev\SpotiFine\e2e\coverage +201ms
  code-coverage Final coverage in C:\Users\thibl\dev\SpotiFine\e2e\coverage\coverage-final.json +0ms
  code-coverage There are 0 key(s) in C:\Users\thibl\dev\SpotiFine\e2e\coverage\coverage-final.json +0ms

versions

  • Cypress 4.4.1
  • Angular 9.1.3
  • code-coverage plugin : 3.5.3
  • os : windows 10
  • shell : powershell
  • Node v12.11.1
  • npm v6.11.3
  • application instrumented using istambul
  • window.coverage : yes
  • no custom NYX setting

describe the bug

Nyc reprter doesn't report coverage when excludeAfterRemap is set to true in common-utils.js file (default plugin configuration), when testing an angular 8+ app.

link to the repo
cypress-code-coverage-bug

workaround

Set excludeAfterRemap to true in common-utils.js file.

@thibleroy thibleroy changed the title excludeAfterRemap set to True makes the reports empty excludeAfterRemap set to truemakes the reports empty Apr 27, 2020
@thibleroy thibleroy changed the title excludeAfterRemap set to truemakes the reports empty excludeAfterRemap set to true makes the reports empty Apr 27, 2020
@bahmutov bahmutov added topic: empty output Cypress generates empty output reports typescript labels Apr 28, 2020
@bahmutov
Copy link
Contributor

Great bug report, so nice, I will link it in the github issue template as an example!

workaround

In package.json set the option

{
  "nyc": {
    "excludeAfterRemap": false
  }
}

Let me see if we can do more in this plugin to solve this, problem is, excludeAfterRemap is not documented in NYC itself

@bahmutov
Copy link
Contributor

Initially, I set excludeAfterRemap: true in examples/exclude-files because in non-interactive mode parcel kept adding coverage for files in the nyc.exclude list. I think it is better to let it be, and explain to the user how to filter files later on.

@bahmutov
Copy link
Contributor

🎉 This issue has been resolved in version 3.5.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@thibleroy
Copy link
Author

thibleroy commented Apr 28, 2020

🎉 This issue has been resolved in version 3.5.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Thank you very much for your prompt response
@AirJulien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released topic: empty output Cypress generates empty output reports typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants