integrations/prisma-exception/vitest.config.ts
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
const testFiles = ['./src/**/*.test.{js,ts}', './test/**/*.test.{js,ts}'];
export default defineConfig({
esbuild: {
target: ['node18'],
},
plugins: [tsconfigPaths()],
cacheDir: '../../.cache/vite/prisma-exception',
test: {
// @link https://vitest.dev/config/#clearmocks
clearMocks: true,
coverage: {
all: true,
include: ['src/**/*.{js,jsx,ts,tsx}'],
provider: 'istanbul',
reporter: ['text', 'json', 'clover'],
},
typecheck: {
enabled: false,
},
pool: 'forks',
poolOptions: {
vmThreads: {
// useAtomics: true,
},
threads: {
// minThreads: 1,
// maxThreads: 16,
useAtomics: true, // perf+
isolate: false, // perf+++
},
},
environment: 'node',
exclude: [
'**/node_modules/**',
'dist/**',
'**/coverage/**',
'**/.{idea,git,cache,output,temp}/**',
],
globals: true,
include: testFiles,
// To mimic Jest behaviour regarding mocks.
mockReset: true,
passWithNoTests: true,
restoreMocks: true,
},
});