docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Helper utilities to wrap integration HTTP calls with fixture record/replay modes so tests can run without live network access.
runWithFixtures('record', 'profile', requestFn) executes requestFn, allows real HTTP, and writes a fixture file fixtures/profile.json capturing each request/response so subsequent runs can replay without network. @testfixtures/profile.json file, runWithFixtures('lockdown', ...) replays responses from the fixture and throws if requestFn triggers a request not represented in the fixture. @testupdate, the helper overwrites fixtures/profile.json with a fresh recording of the current HTTP interactions from requestFn. @testwild, runWithFixtures bypasses fixture loading/recording and lets requestFn hit the network directly without creating or using fixture files. @testexport async function runWithFixtures(mode, fixtureName, requestFn, options);
/**
* @param {'record'|'lockdown'|'update'|'wild'} mode
* @param {string} fixtureName Base name for the fixture file stored under `fixtures/`.
* @param {() => Promise<any>} requestFn Executes HTTP requests that should be recorded or replayed.
* @param {{
* fixtureDir?: string,
* before?: (ctx: { fixturePath: string }) => Promise<void> | void,
* after?: (ctx: { fixturePath: string, recordings?: unknown[] }) => Promise<void> | void
* }} [options]
* @returns {Promise<{ result: any, fixturePath: string }>}
*/HTTP mocking library with fixture record/replay support.