test: mise en place de Vitest + React Testing Library
This commit is contained in:
+9
-1
@@ -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": {
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
import '@testing-library/jest-dom/vitest'
|
||||
Reference in New Issue
Block a user