TheCandidStartup / TheCandidStartup.github.io

The Candid Startup Blog
https://www.thecandidstartup.org
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

2024/03/18/vitest-code-coverage #35

Open utterances-bot opened 7 months ago

utterances-bot commented 7 months ago

Vitest Code Coverage

We’ve got Vitest up and running and have written a few simple tests to check that everything’s working. Today I’m going to look at Vitest’s code coverage story. Code coverage tools provide a useful set of metrics for determining how much of your source code is actually being tested by your test s...

https://www.thecandidstartup.org/2024/03/18/vitest-code-coverage.html

kevinstory commented 7 months ago

How can you increase your coverage for those files that are reporting 0% coverage, like App.tsx?

timwiegand commented 7 months ago

Those files are part of the test app that uses the control. To test at that level you need some form of end to end testing that interacts with the UI in a real browser - e.g. Cypress or Playwright. For these posts I'm concentrating on unit testing, so those files are out of scope.