vitest.config.ts•1.42 kB
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['tests/**/*.test.ts'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['src/**/*.ts'],
exclude: [
'src/**/*.d.ts',
'src/**/*.test.ts',
'src/**/*.spec.ts',
'src/index-old.ts',
'src/improvements.md',
'node_modules/**',
'tests/**',
],
thresholds: {
lines: 80,
functions: 80,
branches: 80,
statements: 80,
},
clean: true,
all: true,
},
testTimeout: 30000,
hookTimeout: 30000,
pool: 'threads',
poolOptions: {
threads: {
singleThread: true,
},
},
reporters: ['verbose'],
setupFiles: ['./tests/setup.ts'],
mockReset: true,
clearMocks: true,
restoreMocks: true,
},
resolve: {
extensions: ['.ts', '.js', '.json'],
alias: {
'@': path.resolve(__dirname, './src'),
'@test': path.resolve(__dirname, './tests'),
},
},
esbuild: {
target: 'node18',
},
});