Files
OllaHub/vitest.config.mts
T

17 lines
640 B
TypeScript

// vitest em vez de node --test: o código usa imports com alias `@/` (tsconfig paths),
// que o node --test não resolve sem loader próprio. Ver spec 2026-11-16-testes-ciclomaticos-ui, seção 5.
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: [{ find: /^@\//, replacement: fileURLToPath(new URL('./', import.meta.url)) }],
},
test: {
include: ['{lib,hooks,services}/**/*.test.ts'],
environment: 'happy-dom', // localStorage para o persist do zustand e DOM para renderHook
restoreMocks: true,
unstubGlobals: true,
},
});