Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

unit-testing

/unit-testing

Opisuje wzorce testów jednostkowych: Vitest z pokryciem v8, testowanie zachowania przez Testing Library, MSW zamiast jest.mock, testy parametryzowane i asynchroniczne.

Repozytorium
alpha-engineer ↗
Licencja
MIT
Ostatnia zmiana repozytorium
24.07.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 24.07.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Opisuje wzorce testów jednostkowych: Vitest z pokryciem v8, testowanie zachowania przez Testing Library, MSW zamiast jest.mock, testy parametryzowane i asynchroniczne.

Oryginalny opis (EN)

Unit testing patterns: Vitest config with v8 coverage, Testing Library behavior testing, MSW for HTTP mocking (vs jest.mock), it.each parametrized tests, spies vs mocks vs stubs, testing async code, snapshot testing guidelines. Use when writing unit and component tests.

Jak działa

  1. When to use
  2. Core principles
  3. References available
Sekcje z nagłówków SKILL.md, w oryginale · 25 linii, 156 słów
Podgląd SKILL.md
---
name: unit-testing
description: |
  Unit testing patterns: Vitest config with v8 coverage, Testing Library behavior testing,
  MSW for HTTP mocking (vs jest.mock), it.each parametrized tests, spies vs mocks vs stubs,
  testing async code, snapshot testing guidelines. Use when writing unit and component tests.
allowed-tools: Read, Grep, Glob
---

# Unit Testing Patterns

## When to use
- Setting up Vitest or Jest for a new project
- Writing unit tests for business logic
- Component testing with Testing Library
- Mocking HTTP requests with MSW
- Parametrized tests with it.each

## Core principles

1. **Test behavior, not implementation** — what does it return/do, not how
2. **MSW over jest.mock** — mock at network level, not module level
3. **One assertion per test** — single reason to fail per test
4. **Arrange-Act-Assert** — consistent structure in every test
5. **No test interdependence** — each test must run independently

## References available
- `references/vitest-config.md` — globals, environment, coverage thresholds, thread pool, MSW setup
- `references/business-logic-testing.md` — pure function tests, AAA pattern, it.each parametrized tests
- `references/msw-http-mocking.md` — handlers setup, server lifecycle, per-test handler overrides
- `references/async-testing.md` — await patterns, rejected promise assertions, try/catch error checks
- `references/testing-library-react.md` — render, screen queries, userEvent vs fireEvent, role queries
Pliki w paczce (5)
  • SKILL.md 1 KB
  • references/backend-testing.md 3 KB
  • references/jest-vitest-patterns.md 3 KB
  • references/mocking-strategies.md 3 KB
  • references/react-testing.md 3 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · rnavarych/alpha-engineer90MIT
nativescript/nativescript100MIT
MARUCIE/openclaw-foundry95MIT
Tyler-R-Kendrick/agent-skills95MIT
kid-sid/codex-spellbook95MIT
OKHP3/skillz90MIT

Migawka bazy z 28.10.2026 · wersja paczki 9dec432d2a8a (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100react-testing
    Opisuje testowanie komponentów React z Testing Library i Vitest: testy jednostkowe i integracyjne, asynchroniczne, mockowanie, zdarzenia użytkownika i dostępność.
  • 100vitest
    Opisuje wzorce Vitest: konfiguracja testów, testy asynchroniczne, mocking przez vi.*, snapshoty i wydajność testów, bez metodyki TDD i MSW.
  • 100vitest
    Opisuje wzorce Vitest: konfiguracja testów, testy asynchroniczne, mocking przez vi.*, snapshoty i wydajność testów, bez metodyki TDD i MSW.
  • 100nextjs-testing
    Pisze testy jednostkowe Jest lub Vitest z React Testing Library oraz testy E2E Playwright dla projektów Next.js, w tym mockowanie API przez MSW.
  • 100vitest
    Obsługuje framework Vitest do testów jednostkowych, mockowania i pokrycia w projektach opartych na Vite i Node.js.
  • 100vitest-testing-patterns
    Pisze testy w Vitest i React Testing Library: testy jednostkowe, komponentów i integracyjne, mockowanie zależności, pokrycie i dobre praktyki.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.