This package includes comprehensive testing setup using Vitest.
- Unit Tests: Located in
src/__tests__/- Test TypeScript functionality
- Test React components (basic structure)
- Test utility functions
# Run all unit tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with UI interface
npm run test:ui
# Run tests with coverage report
npm run test:coverage
# Run Storybook tests
npm run test:storybookThe project uses two test environments:
- Unit Tests: Uses
jsdomenvironment for DOM testing - Storybook Tests: Uses browser environment with Playwright
src/__tests__/index.test.ts- Tests main exportssrc/__tests__/App.test.tsx- Tests React App componentsrc/__tests__/hooks.test.ts- Tests custom hookssrc/__tests__/utils.test.ts- Tests utility functions
Run npm run test:coverage to generate coverage reports.
Tests should follow the existing patterns:
import { describe, it, expect } from 'vitest';
describe('Component/Function Name', () => {
it('should describe what it tests', () => {
expect(actual).toBe(expected);
});
});