Skip to content

lucasmuna/vitest-storybook-coverage-demo

Repository files navigation

COVERAGE DEMO

Minimal reproduction for storybookjs/storybook#31962

How to run

Install all dependencies with npm install and then execute ./coverage.sh (or manually follow its steps).

My results

STORYBOOK COVERAGE

---------------|---------|----------|---------|---------|-------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------|---------|----------|---------|---------|-------------------
All files      |   67.98 |    68.18 |   91.66 |   67.98 |                   
 app           |       0 |       50 |      50 |       0 |                   
  layout.tsx   |       0 |      100 |     100 |       0 | 3-34              
  page.tsx     |       0 |        0 |       0 |       0 | 1-103             
 components/ui |   99.45 |    68.42 |     100 |   99.45 |                   
  button.tsx   |     100 |      100 |     100 |     100 |                   
  form.tsx     |   99.08 |    57.14 |     100 |   99.08 | 53                
  input.tsx    |     100 |      100 |     100 |     100 |                   
  label.tsx    |     100 |      100 |     100 |     100 |                   
 lib           |     100 |      100 |     100 |     100 |                   
  utils.ts     |     100 |      100 |     100 |     100 |                   
---------------|---------|----------|---------|---------|-------------------

UNIT TEST COVERAGE

---------------|---------|----------|---------|---------|--------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s  
---------------|---------|----------|---------|---------|--------------------
All files      |    7.59 |    71.42 |   30.76 |    7.59 |                    
 app           |       0 |       50 |      50 |       0 |                    
  layout.tsx   |       0 |      100 |     100 |       0 | 2-34               
  page.tsx     |       0 |        0 |       0 |       0 | 1-103              
 components/ui |   10.86 |       80 |      30 |   10.86 |                    
  button.tsx   |       0 |      100 |     100 |       0 | 2-57               
  form.tsx     |    17.3 |    66.66 |   14.28 |    17.3 | 35-43,52-67,77-157 
  input.tsx    |       0 |      100 |     100 |       0 | 3-19               
  label.tsx    |    12.5 |      100 |       0 |    12.5 | 8-22               
 lib           |      60 |      100 |       0 |      60 |                    
  utils.ts     |      60 |      100 |       0 |      60 | 5-6                
---------------|---------|----------|---------|---------|--------------------

MERGED COVERAGE

---------------|---------|----------|---------|---------|-----------------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s           
---------------|---------|----------|---------|---------|-----------------------------
All files      |   66.08 |       75 |   63.15 |   66.08 |                             
 app           |       0 |       50 |      50 |       0 |                             
  layout.tsx   |       0 |      100 |     100 |       0 | 3-34                        
  page.tsx     |       0 |        0 |       0 |       0 | 1-103                       
 components/ui |   94.89 |    76.19 |    62.5 |   94.89 |                             
  button.tsx   |     100 |      100 |     100 |     100 |                             
  form.tsx     |   93.22 |    68.75 |   53.84 |   93.22 | 41,53,86-87,104,122,135,155 <---- note here
  input.tsx    |     100 |      100 |     100 |     100 |                             
  label.tsx    |   88.23 |      100 |     100 |   88.23 | 18,20                       <---- note here
 lib           |     100 |      100 |     100 |     100 |                             
  utils.ts     |     100 |      100 |     100 |     100 |                             
---------------|---------|----------|---------|---------|-----------------------------

About

temporary minimal reproduction repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published