envy
envy copied to clipboard
Exclude storybook files from unit tests and ensure 100% unit test coverage
Unit test coverage has dropped from from 100% across the board to
------------------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------------------------|---------|----------|---------|---------|-------------------
All files | 82.12 | 96.5 | 90.62 | 80.78 |
This is mostly down to the .stories.tsx files being included for tests.
Adding the following lines to the collectCoverageFrom section in packages/webui/jest.config.ts will eliminate these:
'!./src/**/*.stories.{ts,tsx}',
'!**/*__mocks__*/**',
...however, coverage is still down and needs to be boosted back to 100%:
----------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------------|---------|----------|---------|---------|-------------------
All files | 98.35 | 97.41 | 99.57 | 98.43 |