homelabby/web/vitest.config.ts
Mikkel Georgsen 4e5a3547f9 test(05-03): add CableTestPage unit tests with Vitest setup
- 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
2026-04-10 07:21:08 +00:00

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'],
},
})