packages/dsn-parser/vitest.cloudflare.config.ts
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config';
import tsconfigPaths from 'vite-tsconfig-paths';
const testFiles = ['./src/**/*.test.{js,ts}', './test/**/*.test.{js,ts}'];
export default defineWorkersConfig({
esbuild: {
target: ['node18'],
},
plugins: [tsconfigPaths()],
cacheDir: '../../.cache/vite/httpx-dsn-parser-cloudflare',
test: {
// @link https://vitest.dev/config/#clearmocks
clearMocks: true,
poolOptions: {
workers: {
wrangler: {
configPath: '../../devtools/vitest/wrangler.toml',
},
},
},
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,
},
});