Open RichieRunner opened 2 years ago
My research has led me to understand that I should be instrumenting code coverage through build, but I've now stumbled onto a new issue, which is this one
The issue for me was during production build mode, I had to force my plugin to do instrumentation (vite-plugin-istanbul + forceBuildInstrumentation option).
Logs and screenshots Please provide debug logs by running Cypress from the terminal with
DEBUG=code-coverage
environment variable set, see the Debugging section of the README file.Versions
@cypress/instrument-cra
and"start:coverage": "nyc --silent node index"
(https://www.cypress.io/blog/2019/09/05/cypress-code-coverage-for-create-react-app-v3/)window.__coverage__
object? Can you paste a screenshot? Yes.nyc_output
folder? Is there.nyc_output/out.json
file. Is it empty? Can you paste at least part of it so we can see the keys and file paths? Yespackage.json
(nyc
object) or in other NYC config files: NoDescribe the bug I'm running Cypress with the command
DEBUG=code-coverage npx cypress run
Cypress is able to generate.nyc_output
locally, but not in automated build (Codebuild). Should the.nyc_output
always be generated by Cypress on everycypress run
?I've recently discovered that my app built out to a server is NOT showing code coverage instrumentation in
window.__coverage
. Does this CRA instrumentation package work only for local environments? How do I instrument the app withnpm run build
?