cypress-documentation
cypress-documentation copied to clipboard
Correct code coverage setup example
Proposed configuration returns Cypress not defined in a real use case.
const { defineConfig } = require('cypress')
module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
e2e: {
setupNodeEvents(on, config) {
require('@cypress/code-coverage/task')(on, config)
// include any other plugin code...
// It's IMPORTANT to return the config object
// with any changed environment variables
return config
}
}
})
Using existing configuration from the RealWorldApp seems working though.
import codeCoverageTask from "@cypress/code-coverage/task";
const { defineConfig } = require('cypress')
module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
e2e: {
setupNodeEvents(on, config) {
codeCoverageTask(on, config);
return config;
},
Deploy request for cypress-docs pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | 51eb525781359af1fb96531dddabfe635af24892 |
@cnotv is attempting to deploy a commit to the Cypress Team on Vercel.
A member of the Team first needs to authorize it.
Hi @cnotv, thanks for the PR. The existing documentation is the correct implementation. Maybe theres another issue going on?
You are right, the issue was definitely somewhere else, as in the end it works also with the code from the documentation. For some reasons it did not trigger the first time, due existing hidden configurations plus Nuxt.js ignoring Babel instrumentation.