Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

testing

/testing

Pomaga pisać testy frontendowe aplikacji nvcf-ui z Vitest, Testing Library i MSW oraz wybierać odpowiednie helpery renderowania; dotyczy TypeScript i React.

Repozytorium
nvcf ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 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ść35 / 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
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

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

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Pomaga pisać testy frontendowe aplikacji nvcf-ui z Vitest, Testing Library i MSW oraz wybierać odpowiednie helpery renderowania; dotyczy TypeScript i React.

Oryginalny opis (EN)

Writing frontend tests for the nvcf-ui app — Vitest, Testing Library, MSW, and project-specific render helpers. Use when creating test files, writing component tests, setting up MSW handlers in tests, deciding which render helper to use, or when the user is adding or modifying a UI component and hasn't mentioned tests yet (tests are required). Covers TypeScript/React only — Go backend tests follow standard Go patterns.

Jak działa

  1. Gotchas
  2. Which Render Helper to Use
  3. MSW in Tests
  4. Guidelines
  5. Validate
Sekcje z nagłówków SKILL.md, w oryginale · 42 linii, 226 słów
Podgląd SKILL.md
---
name: testing
description: >
  Writing frontend tests for the nvcf-ui app — Vitest, Testing Library, MSW, and
  project-specific render helpers. Use when creating test files, writing component tests,
  setting up MSW handlers in tests, deciding which render helper to use, or when the user
  is adding or modifying a UI component and hasn't mentioned tests yet (tests are required).
  Covers TypeScript/React only — Go backend tests follow standard Go patterns.
license: Apache-2.0
allowed-tools:
  - Bash
  - Read
  - Edit
---

# Testing

Tests are not optional — when adding or modifying a component, add or update the corresponding tests.

## Gotchas

- Route-level views that use `useSearch`, `useParams`, or loaders **must** use `renderWithRouter` from `~/testing/render`, not the standard `render`. Using standard `render` will fail because route hooks need router context.
- MSW handlers from scenarios should be reused in tests — don't duplicate handler logic. Import from `~/mocks/scenarios/`.
- Test files live alongside the code they test (`WidgetsList.test.tsx` next to `WidgetsList.tsx`), not in a separate `__tests__` directory.

## Which Render Helper to Use

- **Route-level views** → `renderWithRouter` from `~/testing/render` (sets up router, query client, memory history)
- **Standalone components** (no route dependency) → standard `render` from `@testing-library/react`
- **Pure utility functions** → test directly, no render needed

## MSW in Tests

```typescript
import { setupServer } from "msw/node";
import { getMyHandlers } from "~/mocks/scenarios/myFeature/myScenario";

const server = setupServer(...getMyHandlers());

beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());
```

## Guidelines

- Prefer `screen.getByRole`, `screen.getByText`, and other accessible queries over test IDs
- Use `userEvent` over `fireEvent` for realistic interaction simulation
- Test loading states, error states, and empty states — not just the happy path
- For async operations, use `waitFor` or `findBy` queries

## Validate

1. Run `task ui:test` and verify tests pass
2. If tests fail, fix the issues and rerun until clean

Wersje

RepozytoriumWynikLicencja
Ta strona · nvidia/nvcf100Apache-2.0
wrongstack/wrongstack100MIT
langwatch/langwatch100Apache-2.0
mcouthon/agents100MIT
nteract/nteract100BSD-3-Clause
kettleofketchup/DraftForge100GPL-3.0
TheBeardedBearSAS/claude-craft100MIT
fastrepl/anarlog100MIT
modelcontextprotocol/servers100MIT

Migawka bazy z 28.10.2026 · wersja paczki 623b6f74c8a8 (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

  • 100vitest-rtl-msw-patterns
    Konfiguruje testy frontendu z Vitest, React Testing Library i MSW v2, a także testy kontraktowe Zod względem modeli Pydantic.
  • 100ts-testing
    Pomaga pisać i konfigurować testy TypeScript oraz wybierać między bun test a Vitest.
  • 100react-testing
    Opisuje testowanie komponentów React z Testing Library i Vitest: testy jednostkowe i integracyjne, asynchroniczne, mockowanie, zdarzenia użytkownika i dostępność.
  • 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.
  • 100testing-react
    Pisze testy komponentów, hooków i utilities w React i TypeScript przy użyciu Vitest oraz React Testing Library.
  • 100react-testing
    Testuje komponenty React z React Testing Library oraz Jest lub Vitest.

Uwagi i zgłoszenia

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