Forked from this blog post Combining Storybook, Cypress and Jest Code Coverage, updated to use cypress-react-unit-test to run component tests.
$ yarn
$ yarn run coverage
$ open coverage/lcov-report/index.html
Cypress automatically combines coverage from end-to-end (integration), component and unit tests into a single report.
Test | Description |
---|---|
cypress/integration/spec.js | Full end-to-end test running against the application at localhost:3000 |
src/application/App-spec.js | Component test for App from App.js |
global-styles-spec.js | A test for GlobalStyles component |
src/utilities/addOne.spec.js | Unit test for addOne function |
src/utilities/useToggle.spec.js | Component test for useToggle component |
src/utilities/useToggle.spec.js
in action: