You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: set flag from plugins task that they were registered (#180)
* feat: set flag from plugins task that they were registered
BREAKING CHANGE: the task sets an environment variable and needs
to return its config. The new registration thus looks like this
```js
// your plugins file
module.exports = (on, config) => {
require('cypress/code-coverage/task')(on, config)
// IMPORTANT to return the config object
// with the any changed environment variables
return config
}
```
Support code can check variable `Cypress.env('codeCoverageTasksRegistered')`
before calling `cy.task`
* update readme
* update examples
* add small plugins file
* update readme
* add example using plugins and support
* add new example to CI
* no need to start server in the example
-[bahmutov/code-coverage-subfolder-example](https://github.com/bahmutov/code-coverage-subfolder-example) shows how to instrument `app` folder using `nyc instrument` as a separate step before running E2E tests
350
355
-[bahmutov/docker-with-cypress-included-code-coverage-example](https://github.com/bahmutov/docker-with-cypress-included-code-coverage-example) runs tests inside pre-installed Cypress using [cypress/included:x.y.z](https://github.com/cypress-io/cypress-docker-images/tree/master/included) Docker image and reports code coverage.
351
356
357
+
## Migrations
358
+
359
+
### v2 to v3
360
+
361
+
Change the plugins file `cypress/plugins/index.js`
See [examples/use-plugins-and-support](examples/use-plugins-and-support)
387
+
352
388
## Debugging
353
389
354
390
This plugin uses [debug](https://github.com/visionmedia/debug) module to output additional logging messages from its [task.js](task.js) file. This can help with debugging errors while saving code coverage or reporting. In order to see these messages, run Cypress from the terminal with environment variable `DEBUG=code-coverage`. Example using Unix syntax to set the variable:
0 commit comments