TodoMVC example with full e2e test code coverage
This example is a fork of the official Redux TodoMVC example with a set of Cypress.io end-to-end tests. The tests run instrumented application code and the code coverage is saved automatically using cypress-istanbul plugin.
Install and use
npm ci npm test
The full code coverage HTML report will be saved in
coverage. You can also see text summary by running
npm run report:coverage:text
How it works
Application is served by Parcel bundler that uses .babelrc file to load babel-plugin-istanbul plugin. This plugin instruments the application source code. During tests cypress-istanbul merges and saves application code coverage information, rendering the full HTML report at the end.
Unit tests like cypress/integration/selectors-spec.js that reach into hard to test code paths are also instrumented using the same .babelrc file, and this additional code coverage is automatically added to the application code coverage.
- Code Coverage for End-to-end Tests
- Code Coverage by Parcel Bundler
- Combined End-to-end and Unit Test Coverage
The official Cypress documentation guide to code coverage is coming, follow issue #1705
Code coverage is saved on CircleCI as a test artifact. You can view the full report there by clicking on the "Artifacts" tab and then on "index.html"
The report is a static site, you can drill into each folder to see individual source files. This project should be 100% covered by Cypress tests:
This project is licensed under the terms of the MIT license.