- Add vitest, @testing-library/react, @testing-library/jest-dom, @testing-library/user-event, jsdom - Configure vite.config.ts with jsdom test environment and globals - Add test-setup.ts importing jest-dom matchers
28 lines
564 B
TypeScript
28 lines
564 B
TypeScript
/// <reference types="vitest" />
|
|
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/test-setup.ts'],
|
|
},
|
|
})
|