test: ajoute des tests automatisés frontend (Vitest) et mobile (Jest)
- Frontend Next.js : Vitest + Testing Library - Button (rendu, clic, état loading) - auth-store (setAuth, déconnexion, persistance token) - script `npm test`, config jsdom + alias @/ - Mobile Expo : Jest (preset jest-expo) - getApiError (erreur Axios, validation, erreur générique, sans réponse) - script `npm test`, transformIgnorePatterns adapté - Cahier de tests : section « Outils de test automatisés » (PHPUnit + Vitest + Jest) et entrée 6.4 (PV de recette) au sommaire Suites vertes : backend 15, frontend 6, mobile 4. tsc/lint/build OK, expo-doctor 18/18. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'node:path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
include: ['src/**/*.{test,spec}.{ts,tsx}'],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user