cypress-io / code-coverage

Saves the code coverage collected during Cypress tests
MIT License
421 stars 106 forks source link

Missing `@cypress/code-coverage/use-browserify-istanbul` in 3.10.0 release #573

Open tvsbrent opened 2 years ago

tvsbrent commented 2 years ago

Logs and screenshots

Opening Cypress...
objc[12069]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffb550fc948) and /Users/bschmidt/Library/Caches/Cypress/9.7.0/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x1145b59c8). One of the two will be used. Which one is undefined.
Your pluginsFile threw an error from: /Users/bschmidt/development/oreilly/four_o_four_service/cypress/plugins/index.js

Error: Cannot find module '@cypress/code-coverage/use-browserify-istanbul'

Versions

Version 3.10.0

Describe the bug With the release of the 3.10.0 version of @cypress/code-coverage, the use-browserify-istanbul entry point is missing. In looking at the release, it appears this commit for Cypress 10 compatibility introduced it. However, the entrypoint is still referenced in the README, so I'm assuming that removing that file was a breaking change intended for a major release.

Link to the repo n/a

Fewwy commented 2 years ago

I stumbled upon the same issue

stefcameron commented 2 years ago

Well that was "fun": https://github.com/focus-trap/tabbable/pull/692 (my journey upgrading from Cypress 9.x to 10.0.3), particularly foiled by this very issue.

In the end, it came down to this old code that was still referencing the now-missing dependency:

    on(
      'file:preprocessor',
      require('@cypress/code-coverage/use-browserify-istanbul')
    );

That needed to be replaced with the only one that remains in the 3.10.0 package now, which is @cypress/code-coverage/use-babelrc...

Here's the commit message from the changes that finally got stuff working again:

cypress/code-coverage does NOT instrument the code for you...

https://github.com/cypress-io/code-coverage#instrument-unit-tests

Ah. Finally, circle right back to the original issue of the ellusive
`@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.

Let's see if it works and reports in GH Actions now.
magarwal19-wellsky commented 1 year ago

It is failing for me also, any alternate to fix this and get code coverage?

cjinhuo commented 1 year ago

I have the same issue. It has been for almost one year. Does this issue have ignored?

uniqname commented 1 year ago

This is made all the more confusing because the current docs still reference browserify as an option. Further, there is no indication in commit messages that this was removed, and it was removed on a minor release. At a minimum the Readme should be updated to not reference browserify as an option.

kayeew commented 11 months ago

Any updates on this issue? I am trying to set this up in my project and facing the same issue now. Help anyone?

EDIT: am using cypress v12.17.2

mrdulin commented 4 days ago

+1 for "@cypress/code-coverage": "^3.12.39"