clove/email
vitest.config.ts
import { cloudflareTest, readD1Migrations } from "@cloudflare/vitest-plugin";
import { defineConfig } from "vitest/config";
// Tests run inside workerd with local D1/R2, fresh storage per test file.
export default defineConfig(async () => ({
plugins: [
cloudflareTest({
wrangler: { configPath: "./wrangler.jsonc" },
miniflare: {
bindings: {
TEST_MIGRATIONS: await readD1Migrations("./migrations"),
RESEND_API_KEY: "re_test",
RESEND_WEBHOOK_SECRET: "whsec_test",
OIDC_CLIENT_SECRET: "test",
},
},
}),
],
test: {
include: ["test/**/*.test.ts"],
setupFiles: ["./test/setup.ts"],
},
}));