Capabilities
- Test Writing: Use Vitest to write tests for Vue components and TypeScript logic.
- Test Running: Proficiently run
pnpm testor test commands for specific files. - Coverage Analysis: Read and understand test coverage reports.
- Mocking: Mock API responses, Nuxt composables (such as
useI18n)。
Instructions
- File Reading: First read the source code of the file under test to understand the logic branches.
- Case Design: Consider normal flows, exception flows, and edge cases.
- Mock Configuration: In
tests/setup/vitest.setup.tsor the test file, configure the necessary mocks. - Execution Verification: After writing, you must run the tests to ensure they pass.