testing-patterns
/testing-patterns
Opisuje wzorce pytest z moto, Jest i Vitest z React Testing Library oraz Playwright E2E, także przy debugowaniu porażek.
- Autor
- seandkendall ↗
- Repozytorium
- kiro-config ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Opisuje wzorce pytest z moto, Jest i Vitest z React Testing Library oraz Playwright E2E, także przy debugowaniu porażek.
Oryginalny opis (EN)
pytest with moto, Jest/Vitest with React Testing Library, Playwright E2E patterns. Use when writing or reviewing tests, setting up test infrastructure, or debugging test failures.
Jak działa
- Python Lambda Test (pytest + moto)
- React Component Test (Vitest + RTL)
- Coverage Commands
- Playwright Quick Reference
Podgląd SKILL.md
---
name: testing-patterns
description: pytest with moto, Jest/Vitest with React Testing Library, Playwright E2E patterns. Use when writing or reviewing tests, setting up test infrastructure, or debugging test failures.
---
# Testing Patterns
## Python Lambda Test (pytest + moto)
```python
import pytest
from moto import mock_aws
import boto3, os
@pytest.fixture
def dynamodb_table():
with mock_aws():
os.environ["TABLE_NAME"] = "test-table"
client = boto3.client("dynamodb", region_name="us-east-1")
client.create_table(
TableName="test-table",
KeySchema=[{"AttributeName": "PK", "KeyType": "HASH"}, {"AttributeName": "SK", "KeyType": "RANGE"}],
AttributeDefinitions=[{"AttributeName": "PK", "AttributeType": "S"}, {"AttributeName": "SK", "AttributeType": "S"}],
BillingMode="PAY_PER_REQUEST",
)
yield client
def test_handler_success(dynamodb_table):
from my_function import lambda_handler
result = lambda_handler({"body": '{"name": "test"}'}, MockContext())
assert result["statusCode"] == 200
def test_handler_validation_error(dynamodb_table):
from my_function import lambda_handler
result = lambda_handler({"body": '{}'}, MockContext())
assert result["statusCode"] == 400
```
## React Component Test (Vitest + RTL)
```tsx
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { axe } from 'jest-axe';
test('submits form with valid data', async () => {
const onSubmit = vi.fn();
render(<InvoiceForm onSubmit={onSubmit} />);
await userEvent.type(screen.getByLabelText('Amount'), '100');
await userEvent.click(screen.getByRole('button', { name: 'Submit' }));
expect(onSubmit).toHaveBeenCalledWith(expect.objectContaining({ amount: 100 }));
});
test('has no accessibility violations', async () => {
const { container } = render(<InvoiceForm />);
expect(await axe(container)).toHaveNoViolations();
});
```
## Coverage Commands
- Python: `pytest --cov --cov-report=term-missing --cov-fail-under=90`
- React: `npx vitest --coverage`
- Playwright: `npx playwright test` with `playwright-coverage` or `monocart-coverage-reports`
- Target: 100%. Never settle below 90%.
## Playwright Quick Reference
- Selectors: `page.getByTestId("...")` (uses `data-testid` attribute) — never class/id/tag
- Auth: `storageState` set up once in a setup project, never a UI login flow per test (see `development-quality-gates.md` → "Playwright E2E Standards")
- Waiting: `page.waitForResponse()` / `page.route()` to intercept and wait on network calls, never `page.waitForTimeout(ms)`
- Structure: `tests/e2e/*.spec.ts`, `tests/e2e/pages/*.ts`
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · seandkendall/kiro-config | 100 | Apache-2.0 |
| Reprograme/redevkit | 100 | MIT |
| piomin/claude-ai-spring-boot | 100 | Apache-2.0 |
| FrancoStino/opencode-skills-collection | 100 | MIT |
| rootcastleco/rei-skills | 100 | MIT |
| davila7/claude-code-templates | 100 | MIT |
| svngoku/coding-agents-skills | 100 | MIT |
| organvm-iv-taxis/a-i--skills | 100 | Apache-2.0 |
| leather-io/mono | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki da6a71b20543 (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
Testuje komponenty React z React Testing Library oraz Jest lub Vitest. - 100react-testing
Opisuje wzorce testowania komponentów React: komponenty, hooki, kontekst i formularze, z Vitest Browser Mode, vitest-browser-react i @testing-library/react. - 90js-testing-patterns
Pisze i przegląda testy JavaScript i TypeScript: asercje Jest i Vitest, zapytania React Testing Library i mocki modułów. - 100testing-react
Pisze testy komponentów, hooków i utilities w React i TypeScript przy użyciu Vitest oraz React Testing Library. - 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
Pisze testy jednostkowe, integracyjne, E2E, obciążeniowe i a11y w pytest, vitest, jest i Playwright, z fixtures i mockami.