import { defineWorkersProject, readD1Migrations, } from "@cloudflare/vitest-pool-workers/config"; import path from "node:path"; export default defineWorkersProject(async () => { const migrationsPath = path.join(process.cwd(), "drizzle"); const migrations = await readD1Migrations(migrationsPath); return { test: { setupFiles: ["./src/testSetup.ts"], alias: { "~": path.resolve(process.cwd(), "./src"), }, poolOptions: { workers: { wrangler: { configPath: "./wrangler.toml", }, miniflare: { // Add a test-only binding for migrations, so we can apply them in a // setup file bindings: { TEST_MIGRATIONS: migrations, LOG_DB_QUERIES: "false" }, }, }, }, server: { deps: { inline: ["graphql"], }, }, }, }; });