hotovo

writing-tests

@hotovo/writing-tests
hotovo
1,003
77 forks
Updated 1/6/2026
View on GitHub

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.

Installation

$skills install @hotovo/writing-tests
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Path.aider-desk/skills/writing-tests/SKILL.md
Branchmain
Scoped Name@hotovo/writing-tests

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions


name: Writing Tests description: 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.

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.

Advanced Usage

For detailed information: