HTTP server mocking and expectations library for Node.js testing environments
67
Build a small utility that captures real HTTP traffic to fixture files and replays those fixtures in later runs. The utility should avoid exposing the underlying interception library and provide a clear lifecycle for recording and playback.
@generates
export interface RecordingOptions {
outputFile: string;
includeHeaders?: boolean;
}
export interface PlaybackOptions {
allowUnmocked?: boolean;
}
export function startRecording(options: RecordingOptions): Promise<void>;
export function stopRecording(): Promise<unknown[]>;
export function usePlayback(fixturePath: string, options?: PlaybackOptions): Promise<void>;
export function resetPlayback(): void;Provides HTTP interception, recording, and fixture replay.
Install with Tessl CLI
npx tessl i tessl/npm-nockdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10