add unit test suite: 80 tests across utils, api, auth, clients, events, emails
- Vitest + React Testing Library + jsdom setup - utils.test.ts: cn, formatDate, formatFullDate, getInitials, getRelativeTime, getDaysUntil - api.test.ts: token management, auth, CRUD for clients/events/emails, admin, error handling - auth.test.ts: login, logout, checkSession, setUser - clients.test.ts: fetch, create, update, delete, markContacted, filters - events.test.ts: fetch, create, update, delete, syncAll - emails.test.ts: fetch, generate, update, send, delete
This commit is contained in:
18
vitest.config.ts
Normal file
18
vitest.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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, './src'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
include: ['src/**/*.test.{ts,tsx}'],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user