- Install vitest, @testing-library/react, jsdom (Rule 3: missing test infra) - Add vitest.config.ts with jsdom environment and @ alias - Add src/test/setup.ts with jest-dom matchers and matchMedia stub - Add CableTestPage.test.tsx: 4 tests (no-tester, recent list, print success, print_skipped) - Mock AppShell to avoid TanStack Router context in tests - All 4 tests pass; npm run build exits 0
17 lines
350 B
TypeScript
17 lines
350 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
},
|
|
})
|