vitest.config.tsโข1.14 kB
import { defineConfig } from 'vitest/config';
import { resolve } from 'path';
import { config } from 'dotenv';
// Load environment variables from .env file
config();
export default defineConfig({
test: {
globals: true,
environment: 'node',
setupFiles: ['./tests/conftest.ts'],
include: ['tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
'**/setup.ts', // Exclude setup file from being run as a test
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'test/',
'dist/',
'example-app/',
'**/*.d.ts',
'**/*.config.*',
'**/coverage/**',
],
},
testTimeout: 10000,
hookTimeout: 10000,
teardownTimeout: 5000,
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'@test': resolve(__dirname, './test'),
},
},
});