next-and-cypress-example icon indicating copy to clipboard operation
next-and-cypress-example copied to clipboard

Some issues based on today's state of Cypress code coverage

Open glambert opened this issue 4 years ago • 5 comments

Hey there @bahmutov and team,

I've been writing up an internal recipe on how to install Cypress for a Next.js app, along with code coverage, CircleCI and all goodies to have a fully working setup. Here's a few things I noted while following both this repo and some of the other examples (mainly https://github.com/lluia/cypress-typescript-coverage-example):

  1. Code coverage instrumentation is served to users, compared to https://github.com/lluia/cypress-typescript-coverage-example/blob/ae6c8a3fc0143f15943ee50e248accb0e011c467/babelrc.js#L4 which is prevent it from being bundled in

  2. Cypress 3.8.3 is used which makes the cypress/plugins/index.js portion obsolete when using Cypress 4 and up (using 4.4.0 here at the moment):

    module.exports = (on, config) => {
      require('@cypress/code-coverage/task')(on, config);
      return config;
    };
    

If you agree the repo should be updated to use the latest Cypress version I can open a PR and update it accordingly.

Keep up the good work on Cypress, loving the latest version!

glambert avatar Apr 15 '20 15:04 glambert

Hi @glambert - absolutely, I would love an update, there are PRs opened by renovate bot, but I did not get a chance to get to them yet. Any help would be great, and now v3 of code coverage plugin includes pretty much everything needed to run, so the example should be even simpler

bahmutov avatar Apr 15 '20 15:04 bahmutov

@bahmutov here's the public repo I've created serving as an example: https://github.com/glambert/nextjs-cypress-setup

glambert avatar Apr 15 '20 15:04 glambert

@glambert I'm getting a 404 on that link. Is the repo public?

paleite avatar May 10 '20 11:05 paleite

@paleite not anymore because I used that repo for internal usage, but if you have specific questions I can help out!

glambert avatar May 12 '20 13:05 glambert

Got this handled here FWIW

https://github.com/kylemh/next-ts-with-cypress-coverage

kylemh avatar Jan 12 '21 19:01 kylemh