test: mise en place de Vitest + React Testing Library

This commit is contained in:
2026-07-04 01:15:24 +04:00
parent 399796bb73
commit 3f30f699f7
4 changed files with 793 additions and 5 deletions
+9 -1
View File
@@ -17,7 +17,9 @@
"lint": "xo",
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@emotion/cache": "^11.11.0",
@@ -57,11 +59,17 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@vitejs/plugin-react": "^6.0.3",
"eslint": "^8.7.0",
"eslint-config-next": "16.2.4",
"eslint-config-xo-nextjs": "^4.0.3",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"jsdom": "^29.1.1",
"vitest": "^4.1.9",
"xo": "^0.47.0"
},
"xo": {
+11
View File
@@ -0,0 +1,11 @@
import {defineConfig} from 'vitest/config'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
setupFiles: ['./vitest.setup.js'],
globals: true,
},
})
+1
View File
@@ -0,0 +1 @@
import '@testing-library/jest-dom/vitest'
+772 -4
View File
File diff suppressed because it is too large Load Diff