Write unit tests, component tests, and integration tests for AiderDesk using Vitest and React Testing Library. Use when creating new tests, adding test coverage, configuring mocks, setting up test files, or debugging failing tests.
100
Does it follow best practices?
Agent success when using this skill
Validation for skill structure
Test organization and file placement
Utility test placement
0%
100%
Service test placement
0%
100%
Utility test filename
100%
100%
Service test filename
100%
100%
Vitest named imports
100%
100%
vi.mock for fs
100%
100%
vi.clearAllMocks in beforeEach
0%
100%
vi.mocked usage
100%
100%
Imperative test descriptions
0%
0%
Correct npm script in NOTES
0%
100%
Placement rationale in NOTES
30%
100%
Without context: $0.2538 · 1m 2s · 12 turns · 12 in / 3,757 out tokens
With context: $0.4030 · 1m 5s · 21 turns · 484 in / 3,563 out tokens
Centralized mock factories for React contexts
createMockApi import path
0%
100%
createMockTaskContext import path
100%
100%
vi.mock for ApiContext
100%
100%
vi.mock for TaskContext
100%
100%
Factory in beforeEach
60%
100%
vi.clearAllMocks in beforeEach
0%
100%
No inline mock objects
80%
100%
Colocated test placement
100%
100%
Test file extension
100%
100%
Correct npm script in NOTES
100%
100%
Factory override usage
100%
100%
Without context: $1.2266 · 5m 15s · 13 turns · 13 in / 5,610 out tokens
With context: $0.5415 · 1m 16s · 22 turns · 263 in / 4,640 out tokens
Hook testing with fake timers and async patterns
renderHook import
100%
100%
act import
0%
100%
vi.useFakeTimers in beforeEach
100%
100%
vi.restoreAllMocks in afterEach
0%
0%
vi.clearAllMocks in beforeEach
0%
0%
Colocated hook test placement
0%
100%
Hook test filename
75%
100%
Imperative test descriptions
87%
75%
Vitest named imports
100%
100%
Correct npm script in NOTES
0%
100%
Timer advancement with act
0%
100%
Without context: $0.3948 · 1m 55s · 18 turns · 67 in / 5,574 out tokens
With context: $0.4028 · 1m 8s · 20 turns · 1,426 in / 3,860 out tokens
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.