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).
20 lines
432 B
TypeScript
20 lines
432 B
TypeScript
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, '.'),
|
|
},
|
|
},
|
|
});
|