2

I am trying to get a HTML coverage report produced with the JSON output from the @storybook/addon-coverage plugin.

I am using Angular, and have been following this recipe

I have checked as per the guide that I am getting coverage generated as per the steps they mention:

  1. Open your Storybook
  2. Open developer tools
  3. Select the storybook-preview-iframe as a target
  4. Type coverage and see if it evaluates to an object containing information about your components. If it does, then you're good to go!

When I run the storybook test command, I don't see any breakdown of my components coverage details, I just see files from my .storybook directory.

enter image description here

I do get a very large generated JSON file in a coverage directory however, and when examining this I can see all my components and their coverage info are detailed here.

I'd like for the terminal summary output to correctly show the components coverage, but more importantly I'd like to now get a HTML report generated.

So far I have tried using nyc based on this github issue

so: npx nyc report --reporter=html --temp-dir=coverage --report-dir=coverage

This does generate a HTML report, but empty enter image description here

Grokify
  • 15,092
  • 6
  • 60
  • 81
mindparse
  • 6,115
  • 27
  • 90
  • 191

0 Answers0