writing-tests | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / tools / writing-tests

writing-tests

maintained by hotovo

star 1k account_tree 80 verified_user MIT License
bolt View GitHub

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:

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 1k
GitHub Forks 80
Created Jan 2026
Last Updated il y a 5 mois
tools tools testing

Related Skills

test-driven-development
chevron_right
checking-visuals
chevron_right
write-test
chevron_right
test-tdd
chevron_right
test-msw
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.