Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Visual Coverage Test + Combined Code Coverage for Coveralls (#275)
Use storybook test-runner and `@storybook/addon-coverage` to get visual coverage report. The setup requires spinning up storybook before generating the coverage numbers. Now, we have three test scripts: - test => combined test coverage - test:unit => jest test coverage only - test:visual => story book coverage only (note: this only collect coverage on src/components) Updated coverage github action to also create/update comment which display code coverage percentage for unit, visual, and combined tests the test-runner only works with jest v27 right now. As nidhi noted in her [pr](#274), storybook will be adding support for v28 shortly (storybookjs/test-runner#154). [playwright](https://www.npmjs.com/package/playwright) library is needed in the github action for test-storybook. <img width="600" alt="Screen Shot 2022-08-03 at 4 51 03 PM" src="https://user-images.githubusercontent.com/36055303/182709211-0189bad6-e978-4f82-9ee4-ba62be350283.png"> NOTE: The report generated from `nyc` merge command may not be super accurate after some comparison between to the unit vs visual vs merge report (ex: [github issue](istanbuljs/nyc#1302)). J=SLAP-2269 & SLAP-2270 TEST=manual&auto - See that running `npm run test:visual` generates lcov report in coverage/visual folder. And the report is printed out in terminal. - See that a comment is made to the PR about the three coverage percentages. - See that coverall percentage increase without changes to tests (increased due to combined test coverage)
- Loading branch information