FormidableLabs / FormidableLabs/envy
Exclude storybook files from unit tests and ensure 100% unit test coverage
- Dominant language
- TypeScript
- Stars
- 144
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
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 |
```
Contributor guide
Assessment
This issue has not been assessed yet.