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
25 lines
598 B
TypeScript
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;
|
|
}
|
|
},
|
|
},
|
|
});
|