fix: ignore convex-test scheduler unhandled rejections in Vitest
All checks were successful
CI / Lint, Typecheck & Test (push) Successful in 2m11s
All checks were successful
CI / Lint, Typecheck & Test (push) Successful in 2m11s
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user