Domain: Coding
Difficulty: Intermediate
Description: Currently, the project lacks unit tests, making it difficult to verify the correctness of individual functions and hooks in isolation. As outlined in the roadmap, this task involves setting up the Vitest testing framework to enable fast and efficient unit testing.
Expected Outcome:
- vitest and jsdom are added as dev dependencies.
- A vitest.config.ts file is created and configured for the project.
- At least one utility function (e.g., from utils/utils.ts) has a corresponding .test.ts file with passing tests.
- The package.json scripts section includes a new test command that runs Vitest.
Links or References:
Setup Steps:
- Run npm install -D vitest jsdom @testing-library/react.
- Create vitest.config.ts at the project root.
- Create a tests directory within src for unit and integration tests.
- Write a test file for a simple utility, such as src/utils/debounce.ts.
- Run npm test and ensure it passes.