Środowisko testowe zostało pomyślnie skonfigurowane.
# Tryb watch (rekomendowany podczas developmentu)
npm run test
# Lub z UI
npm run test:ui# Upewnij się, że aplikacja jest uruchomiona
npm run dev
# W nowym terminalu
npm run test:e2e
# Lub z UI
npm run test:e2e:ui- Przeczytaj dokumentację: Zobacz TESTING.md dla pełnej dokumentacji
- Sprawdź przykłady:
src/test/example.test.tsx- testy jednostkowee2e/example.spec.ts- testy E2E
- Pisz własne testy: Wykorzystaj przykłady jako szablon
- ✅ Vitest - testy jednostkowe i integracyjne
- ✅ @testing-library/react - testowanie komponentów React
- ✅ MSW - mockowanie API
- ✅ Playwright - testy E2E
- ✅ @axe-core/playwright - testy dostępności
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
describe('MyComponent', () => {
it('should render correctly', () => {
render(<MyComponent />);
expect(screen.getByText('Hello')).toBeInTheDocument();
});
});import { test, expect } from "@playwright/test";
test("should navigate to login", async ({ page }) => {
await page.goto("/");
await page.getByRole("link", { name: /login/i }).click();
await expect(page).toHaveURL(/.*login/);
});# Uruchom wszystkie testy jednostkowe
npm run test:run
# Testy powinny przejść ✅- Pisz testy dla swoich komponentów i features
- Uruchamiaj testy lokalnie przed commitem
- GitHub Actions skonfigurujesz później, gdy będzie potrzebne
- Zobacz TESTING.md w sekcji Troubleshooting
- Sprawdź czy wszystkie przeglądarki są zainstalowane:
npx playwright install