This project uses Vitest for unit tests and Playwright for E2E tests.
npm test
npm run test:ui
npm run test:coveragesrc/**/*.test.tsx- Component unit testssrc/test/setup.ts- Global Vitest configurationsrc/test/test-utils.tsx- Reusable test utilities
Coverage is generated with @vitest/coverage-v8 and reports are available in coverage/.
Install Playwright browsers:
npx playwright installnpm run test:e2e
npm run test:e2e:ui
npm run test:e2e:debuge2e/**/*.spec.ts- E2E testsdemo/- Demo application for E2E testsplaywright.config.ts- Playwright configuration
To manually test the library:
npm run dev:demoTests include accessibility checks:
- Correct ARIA attributes
- Keyboard navigation
- Screen reader announcements
- Focus trap
To integrate tests into your CI/CD pipeline:
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run test:coverage
- run: npx playwright install --with-deps
- run: npm run test:e2e