Files
better-auth/dev/cloudflare/vitest.config.ts
Rahul Mishra d7f66335f5 feat: add cloudflare worker basic tests (#1524)
* feat: add cloudflare worker basic tests

* chore: fix conflict

---------

Co-authored-by: Bereket Engida <bekacru@gmail.com>
2025-02-22 20:18:34 +03:00

27 lines
603 B
TypeScript

import {
defineWorkersProject,
readD1Migrations,
} from "@cloudflare/vitest-pool-workers/config";
import path from "node:path";
export default defineWorkersProject(async () => {
const migrationsPath = path.join(__dirname, "drizzle");
const migrations = await readD1Migrations(migrationsPath);
return {
test: {
setupFiles: ["./test/apply-migrations.ts"],
poolOptions: {
workers: {
singleWorker: true,
wrangler: { configPath: "./wrangler.jsonc" },
miniflare: {
d1Databases: ["DB"],
bindings: { TEST_MIGRATIONS: migrations },
},
},
},
},
};
});