Toolverse
All skills

essential-test-patterns

by growilabs

GROWI testing patterns with Vitest, React Testing Library, and vitest-mock-extended.

Installation

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

Installation

Quick info

Author
growilabs
Category
Testing
Views
2

About this skill

GROWI testing patterns with Vitest, React Testing Library, and vitest-mock-extended.

How to use

  1. Zainstaluj Vitest i vitest-mock-extended w swoim projekcie GROWI, jeśli jeszcze tego nie zrobiłeś. Upewnij się, że tsconfig.json zawiera "types": ["vitest/globals"] w compilerOptions, aby włączyć globalne API testowe bez konieczności importowania describe, it, expect i innych funkcji.

  2. Umieszczaj pliki testów w tym samym katalogu co testowany kod źródłowy. Dla testów jednostkowych i komponentów używaj rozszerzenia .spec.ts lub .spec.tsx, dla testów integracyjnych używaj .integ.ts. Vitest automatycznie wybierze odpowiednie środowisko (Node.js dla .ts, happy-dom dla .tsx).

  3. Pisz testy jednostkowe dla czystych funkcji i usług, używając describe i it bez dodatkowych importów. Wykorzystaj beforeEach i afterEach do konfiguracji i czyszczenia stanu między testami.

  4. Do testowania komponentów React użyj React Testing Library w połączeniu z Vitest. Pliki .spec.tsx będą automatycznie uruchamiane w środowisku happy-dom.

  5. Dla testów wymagających bazy danych lub API użyj rozszerzenia .integ.ts. Vitest uruchomi je w środowisku Node.js z dostępem do bazy danych.

  6. Twórz type-safe mocki za pomocą vitest-mock-extended, importując mockDeep i DeepMockProxy. Dzięki temu uzyskasz TypeScript autocomplete i bezpieczeństwo typów podczas mockowania zależności.

Related skills

hono

by openstatusHQ

Efficiently develop Hono applications using Hono CLI. Supports documentation search, API reference lookup, request testing, and bundle optimization.

Testing
1257

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

pair-trade-screener

by tradermonty

Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair

Testing
994

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

testing-workflow

by amo-tech-ai

Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.

Testing
1076

nextjs-developer

by zenobi-us

Expert Next.js developer mastering Next.js 14+ with App Router and full-stack features. Specializes in server components, server actions, performance optimization, and production deployment with focus on building fast, SEO-friendly applications.

Testing
166226