next-and-cypress-example
next-and-cypress-example copied to clipboard
Some issues based on today's state of Cypress code coverage
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):
-
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
-
Cypress 3.8.3 is used which makes the
cypress/plugins/index.js
portion obsolete when using Cypress 4 and up (using4.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!
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 here's the public repo I've created serving as an example: https://github.com/glambert/nextjs-cypress-setup
@glambert I'm getting a 404 on that link. Is the repo public?
@paleite not anymore because I used that repo for internal usage, but if you have specific questions I can help out!
Got this handled here FWIW
https://github.com/kylemh/next-ts-with-cypress-coverage