From c1ab930e48ba30b4490a89304ab430c58903fceb Mon Sep 17 00:00:00 2001 From: ianshaloom Date: Sun, 8 Mar 2026 01:20:22 +0300 Subject: [PATCH] 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 --- vitest.config.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vitest.config.ts b/vitest.config.ts index 68ec420..fa8ebba 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -10,5 +10,15 @@ export default defineConfig({ 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; + } + }, }, });