@variablesoftware/mock-d1
Version:
🎛️🗂️🧠 Mock D1 Database implementation for testing Cloudflare Workers
14 lines (13 loc) • 674 B
TypeScript
import { FakeD1Result, MockD1PreparedStatement } from '../types/MockD1Database.js';
/**
* @file helpers/mockBatch.ts
* @description Provides the mock-only `batch` method for mockD1Database.
* @warning This is a mock/test-only API. Do not use in production. Will emit a warning if called outside test.
*/
/**
* Executes multiple prepared statements in parallel (mock only).
* Emits a warning if used outside of test environments.
* @param statements - Array of prepared statements.
* @returns Promise resolving to an array of FakeD1Result objects.
*/
export declare function mockBatch<T = unknown>(statements: MockD1PreparedStatement[]): Promise<FakeD1Result<T>[]>;