mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
* feat: add cloudflare worker basic tests * chore: fix conflict --------- Co-authored-by: Bereket Engida <bekacru@gmail.com>
27 lines
603 B
TypeScript
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 },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|