@cypress/code-coverage/use-browserify-istanbul reference which
no longer exists in version 3.10.0 of @cypress/code-coverage.
The only thing cypress/code-coverage provides now is
@cypress/code-coverage/use-babelrc, which has peer dependencies
on webpack, babel-loader, babel/preset-env and babel/core.
After all those added, and babel.config.js configured under 'test'
env (and added BABEL_ENV=test to package.json 'test:coverage'
script that runs Cypress with coverage option, as well as GH ci.yml),
things are looking good locally with .nyc_output/out.json once again
generated.
Solution 2
When I set up the coverage report for Cypress, I went with the approach using use-browserify-istanbul, as described in the official readme. See cypress/plugins/index.js in my repo.
Problem
Cypress 10 requires
@cypress/code-coverage@3.10.0
.But
code-coverage@3.10.0
fails to run with the following error:This is a known issue: https://github.com/cypress-io/code-coverage/issues/573
Solution 1
A solution (cited in this post) is:
Solution 2
When I set up the coverage report for Cypress, I went with the approach using
use-browserify-istanbul
, as described in the official readme. Seecypress/plugins/index.js
in my repo.I can try an alternative approach, also described in the official readme.
Solution 3
Start from scratch: read Cypress docs on code coverage.