Code coverage

Code coverage can be a useful metric if done right. I find code coverage more of a guide to tell you about the state of your test suite than a barred threshold one must pass and never, ever lower. It can point to the areas you haven't covered with tests but you are still the one to decide the appropriate strategy to address that.
You can learn more about code coverage, its dangers, and where you would use it in my article called 📜 Making Sense of Code Coverage.
Vitest, like many other testing frameworks, allows you to enable and configure code coverage for any type of tests. It supports two coverage providers:

Your task

👨‍💼 In this one, you will enable code coverage in , inspect its report, and see if it hints you at any missing test cases you might add.
🐨 Start from installing @vitest/coverage-v8 to use as a coverage provider.
npm i @vitest/coverage-v8 --save-dev
🐨 Next, head to and adjust the configuration to enable code coverage and use the newly installed provider.
🐨 Run tests via npm test and see the generated code coverage report. Explore it to spot any weak or missing spots in the current test suites. Optionally, add the missing tests.

Please set the playground first

Loading "Code coverage"
Loading "Code coverage"

No tests here 😢 Sorry.