D1 Testing Utilities
applyD1Migrations()
Apply D1 migrations from a directory.
D1Database
required
D1 database binding
string
required
Path to migrations directory containing SQL files
Promise<void>
Resolves when migrations are complete
listD1Databases()
List all D1 databases in local development.
string
required
Path to D1 persistence directory
Promise<string[]>
Array of database names
getD1DatabasePath()
Get the SQLite file path for a D1 database.
string
required
Path to D1 persistence directory
string
required
Database name
string
Full path to the SQLite database file
Pages Testing Utilities
getPagesAssetFetcher()
Get a fetcher for Pages assets.
PagesAssetOptions
required
Fetcher
Fetcher for serving static assets
readPagesConfig()
Read and parse a Pages configuration file.
string
required
Path to Pages config file
Promise<PagesConfig>
Parsed Pages configuration