/** * Per-test D1 isolation. Registers vitest `beforeEach` + `afterEach` hooks * that (a) apply the framework migrations to `env.DB`, and (b) drop every * non-system table between tests so the next `beforeEach` re-applies from a * clean slate. * * Right for tests that mutate D1 (`test/integration/*.test.ts`). Cheap * enough for per-test isolation because singleWorker + in-memory D1 keeps * everything on one runtime instance. * * describe('LeadStore', () => { * withIsolatedD1(); * * it('upserts a lead', async () => { * const leads = new LeadStore({ db: createDb(env.DB) }); * await leads.upsert('5511...', { name: 'Carlos' }); * }); * }); * * Prerequisites in your `vitest.config.ts`: * * - `defineWorkersProject` from `@cloudflare/vitest-pool-workers/config` * - `singleWorker: true` under `poolOptions.workers` * - `TEST_MIGRATIONS` binding populated via `readD1Migrations` * * See [`docs/TESTING.md`](../../docs/TESTING.md) for the full recipe. */ export declare function withIsolatedD1(): void; //# sourceMappingURL=index.d.ts.map