Toolverse
All skills

writing-tests

by hotovo

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

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
hotovo
Category
Testing
Views
1

About this skill

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.

How to use

  1. Zainstaluj umiejętność w swoim projekcie AiderDesk, dodając ją do katalogu .aider-desk/skills/. Sprawdź, czy masz zainstalowane Vitest i React Testing Library w zależnościach projektu.

  2. Utwórz nowy plik testowy w odpowiedniej lokalizacji — dla testów jednostkowych użyj src/common/__tests__/utils/, dla testów komponentów src/renderer/__tests__/. Nazwij plik z sufiksem .test.ts lub .test.tsx.

  3. Napisz test, importując funkcje z Vitest (describe, it, expect) i testowaną funkcję lub komponent. Dla testów jednostkowych skupiaj się na czystych funkcjach i logice, dla komponentów testuj interakcje użytkownika i props.

  4. Jeśli testujesz kod z zależnościami, użyj vi.mock() do mockowania modułów. Umiejętność zawiera przewodniki po fabrykom mocków i wzorcach API w pliku references/mocking-guide.md.

  5. Uruchom testy poleceniem npm run test. Jeśli test się nie powiedzie, przeczytaj komunikat błędu, sprawdź konfigurację mocków i ścieżki importów. Do debugowania użyj screen.debug() w testach komponentów lub uruchom pojedynczy test: npm run test:node -- --no-color -t "nazwa testu".

  6. Zweryfikuj pokrycie kodu poleceniem npm run test:coverage, aby upewnić się, że nowy kod jest testowany. Szczegółowe informacje o organizacji testów, poleceniach CLI i best practices znajdziesz w plikach referencyjnych umiejętności.

Related skills

playwright-cli

by microsoft

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

Testing
45103

go-dev-guidelines

by jumppad-labs

This skill should be used when writing, refactoring, or testing Go code. It provides idiomatic Go development patterns, TDD-based workflows, project structure conventions, and testing best practices using testify/require and mockery. Activate this skill when creating new Go

Testing
1190

crypto-research

by stevengonsalvez

Comprehensive cryptocurrency market research and analysis using specialized AI agents. Analyzes market data, price trends, news sentiment, technical indicators, macro correlations, and investment opportunities. Use when researching cryptocurrencies, analyzing crypto markets,

Testing
14118

creating-financial-models

by anthropics

This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

Testing
25137

ppt-creator

by daymade

Create professional slide decks from topics or documents. Generates structured content with data-driven charts, speaker notes, and complete PPTX files. Applies persuasive storytelling principles (Pyramid Principle, assertion-evidence). Supports multiple formats (Marp,

Testing
2739

python-testing-patterns

by wshobson

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

Testing
46146