Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude storybook files from unit tests and ensure 100% unit test coverage #149

Open
kgpax opened this issue Oct 24, 2023 · 0 comments
Open
Labels
@envyjs/webui Browser package

Comments

@kgpax
Copy link
Member

kgpax commented Oct 24, 2023

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 |                   
@kgpax kgpax added the @envyjs/webui Browser package label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@envyjs/webui Browser package
Projects
None yet
Development

No branches or pull requests

1 participant