Files
errors.bitreport.pt/web/vitest.config.ts
T
David SantosandPaperclip 94d2d12c97 feat(web): add Vitest test framework with 8 test files (BIT-14221)
- Install Vitest, @testing-library/react, @testing-library/user-event,
  @testing-library/jest-dom, jsdom, @vitest/coverage-v8
- Add vitest.config.ts with jsdom environment and v8 coverage
- Add src/test/setup.ts with jest-dom matchers
- Write 5 component tests and 3 integration tests for LoginPage:
    renders, form-fields, button-state, error-alert, loading-state,
    submit-success, submit-error-response, submit-network-error
- 31 tests pass; 92%+ stmt/branch coverage on page.tsx
- Add test-web CI job to .gitea/workflows/ci.yml

Co-Authored-By: Paperclip <[email protected]>
2026-04-27 07:53:58 +00:00

24 lines
529 B
TypeScript

import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'node:path';
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
globals: true,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.{ts,tsx}'],
exclude: ['src/test/**', '**/*.d.ts'],
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});