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.
- Autor
- rnavarych ↗
- Repozytorium
- alpha-engineer ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 24.07.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 5
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 24.07.2026, bez odwołań do wycofanych modeli i API.
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
- When to use
- Core principles
- References available
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
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · rnavarych/alpha-engineer | 90 | MIT |
| nativescript/nativescript | 100 | MIT |
| MARUCIE/openclaw-foundry | 95 | MIT |
| Tyler-R-Kendrick/agent-skills | 95 | MIT |
| kid-sid/codex-spellbook | 95 | MIT |
| OKHP3/skillz | 90 | MIT |
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.