Files
the-pet-loft/vitest.config.ts
ianshaloom c1ab930e48
All checks were successful
CI / Lint, Typecheck & Test (push) Successful in 2m11s
fix: ignore convex-test scheduler unhandled rejections in Vitest
Add onUnhandledError to filter 'Write outside of transaction ...
_scheduled_functions' errors so CI passes. These occur when
order/fulfillment mutations schedule email sends and convex-test
runs them after the transaction closes.

Made-with: Cursor
2026-03-08 01:20:22 +03:00

25 lines
598 B
TypeScript

import path from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "apps/storefront/src"),
},
},
test: {
environment: "edge-runtime",
server: { deps: { inline: ["convex-test"] } },
onUnhandledError(error): boolean | void {
const msg = error?.message ?? String(error);
if (
typeof msg === "string" &&
msg.includes("Write outside of transaction") &&
msg.includes("_scheduled_functions")
) {
return false;
}
},
},
});