Open History to see the last commit
1import { defineConfig } from 'vitest/config'
2
3// Two projects: plain unit tests run in node; *.worker.test.ts files run in
4// workerd via @cloudflare/vitest-pool-workers with real KV/D1 bindings (the
5// @cloudflare/vite-plugin is incompatible with vitest, see vite.config.ts).
6export default defineConfig({
7 test: {
8 // better-auth's withSpan telemetry leaves a floating rejection for
9 // APIErrors it already surfaced as 4xx responses (invalid OTP, duplicate
10 // email). Ignore exactly that class; everything else still fails runs.
11 onUnhandledError(error) {
12 if ((error as { name?: string }).name === 'APIError') return false
13 },
14 projects: ['./vitest.unit.config.ts', './vitest.workers.config.ts'],
15 },
16})