Writing tests
Comprehensive guide for writing unit tests, integration tests, and component tests in AiderDesk using Vitest. Use when creating new tests, configuring mocks, or organizing test files.From its SKILL.md
npx -y skills add DrOlu/agent-skills --skill writing-testsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.7 KB, 333 tokens by cl100k_base, as published. Nobody here has run it
Writing Tests
Write effective tests using Vitest and React Testing Library.
Quick Start
Create a unit test in src/common/__tests__/utils/math.test.ts:
import { describe, it, expect } from 'vitest';
import { add } from '../../utils/math';
describe('math utility', () => {
it('adds two numbers correctly', () => {
expect(add(1, 2)).toBe(3);
});
});
Run tests with npm run test.
Core Patterns
Unit Testing
Focus on pure functions and logic in src/main or src/common. Use vi.mock() for dependencies.
Component Testing
Test React components in src/renderer. Focus on user interactions and props.
Mocking
Use centralized mock factories for consistent testing across components and contexts.
- references/mocking-guide.md - Mock factories and API patterns
Advanced Usage
For detailed information:
- references/test-organization.md - Directory structure and naming
- references/running-tests.md - CLI commands and coverage
- references/best-practices.md - Principles and patterns
- references/test-patterns.md - Code templates
- assets/test-checklist.md - Pre-flight checklist
What ships with it: 8 files
34.2 KB alongside SKILL.md
assets/
- test-checklist.md967 B
references/
- best-practices.md1.9 KB
- component-testing-patterns.md18.1 KB
- mocking-guide.md6.5 KB
- running-tests.md918 B
- test-organization.md1.6 KB
- test-patterns.md3.0 KB
- unit-testing-examples.md1.3 KB