test: fix react 19 compatibility and create vitest configuration
- Upgrade @testing-library/react from ^14.0.0 to ^16.0.0 (supports React 19) - Create vitest.config.ts with jsdom environment, v8 coverage, and 80% coverage thresholds - Run clean npm install - 829 packages added successfully - Vitest 1.6.1 verified and operational
This commit is contained in:
3890
frontend/package-lock.json
generated
3890
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^6.0.0",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@testing-library/user-event": "^14.0.0",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
|
||||
35
frontend/vitest.config.ts
Normal file
35
frontend/vitest.config.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
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, './'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./tests/setup.ts'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'html'],
|
||||
all: true,
|
||||
lines: 80,
|
||||
functions: 80,
|
||||
branches: 80,
|
||||
statements: 80,
|
||||
include: ['components/**', 'hooks/**', 'lib/**', 'app/**'],
|
||||
exclude: [
|
||||
'node_modules/',
|
||||
'tests/',
|
||||
'.next/',
|
||||
'coverage/',
|
||||
'**/*.test.tsx',
|
||||
'**/*.spec.ts',
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user