chromaui/chromatic-cli

Storybook addon-coverage support from the CI chromatic task

majoncas-ue opened this issue · 1 comments

Feature request

Currently the test-storybook command is automatically handled by our Github CI task but there are no way to connect it to the Storybook "addon-coverage" (https://github.com/storybookjs/addon-coverage) tool at the moment.

Proposed solution

I would expect being able to set a configuration object or some flags so I can use the addon-coverage tool the same way as I do locally. I would also expect being able to generate nyc report and make my pipeline failing if I don't meet the expected coverage threshold.

Alternative solutions

I could run my custom "yarn test-storybook --coverage" and then run this other command "yarn npx nyc report --check-coverage --branches=93 --functions=80 --lines=89 --statements=90 --reporter=lcov -t coverage/storybook --report-dir coverage/storybook" through the CI but it would mean that we would run the storybook tests twice (one time in Chromatic step and another time in the second step). This would increase the pipeline execution time and I think this should be avoided.