mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
0a408c21ac
jsdom replaces globalThis.AbortController with its own implementation; Node.js undici-based fetch validates signals via instanceof against the native AbortSignal, causing fetch to throw before MSW could intercept. Fix via custom Vitest environment (tests/environment/jsdom-native-abort.ts) that captures native AbortController/AbortSignal before jsdom patches them and restores them after jsdom setup. Also updates JournalBody test 004 to match component behaviour (headings rendered as <p>) and removes debug console.log statements.
30 lines
719 B
TypeScript
30 lines
719 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
root: '.',
|
|
globals: true,
|
|
environment: './tests/environment/jsdom-native-abort.ts',
|
|
include: [
|
|
'tests/**/*.test.{ts,tsx}',
|
|
'src/**/*.test.{ts,tsx}',
|
|
],
|
|
setupFiles: ['tests/setup.ts'],
|
|
testTimeout: 15000,
|
|
hookTimeout: 15000,
|
|
pool: 'forks',
|
|
silent: false,
|
|
reporters: ['verbose'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['lcov', 'text'],
|
|
reportsDirectory: './coverage',
|
|
include: ['src/**/*.{ts,tsx}'],
|
|
exclude: ['src/main.tsx', 'src/vite-env.d.ts'],
|
|
},
|
|
css: false,
|
|
},
|
|
});
|