Example of Cypress.io code coverage collected from webpack dev server
Webpack dev server setup following blog post Webpack with Babel 7 Project Setup.
Install and start
npm ci npm start
To serve the app using webpack-dev-server with instrumented app and open Cypress use:
npm run dev
window.__coverage__ object in the application iframe:
To run headless end-to-end tests and have coverage use:
npm run e2e
In both cases, the coverage HTML report will be saved, open it with
See package.json for all NPM scripts.
- Read Cypress code coverage guide