Add Vitest + React Testing Library setup for viewer-frontend
Establishes frontend unit testing infra (jsdom env, RTL, jest-dom matchers, common Radix/jsdom polyfills) and seeds it with tests for lib/utils.ts, lib/photo-utils.ts, hooks/useFocusTrap.ts, and ThemeToggle.tsx (46 tests total).
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import path from 'path';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
include: ['**/*.test.{ts,tsx}'],
|
||||
exclude: ['node_modules', '.next', 'e2e'],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '.'),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user