Skip to content

Storybook code coverage example and combine with integration, unit test coverage

Notifications You must be signed in to change notification settings

bahmutov/storybook-code-coverage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storybook code coverage example

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

Coverage

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:

useToggle component test

Read My Vision for Component Tests in Cypress

About

Storybook code coverage example and combine with integration, unit test coverage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.1%
  • HTML 12.3%
  • CSS 2.6%