request-mocking-protocol
Version:
A protocol for declarative mocking of HTTP requests
22 lines • 834 B
TypeScript
/**
* Declarative Mocking Protocol.
*
* This protocol is used to declaratively define mocks, that can be passed over the wire.
* Request schema is used to match the request.
* Response schema is used to generate the response.
*/
import { MockRequestSchema, MockRequestSchemaInit } from './request-schema';
import { MockResponseSchema, MockResponseSchemaInit } from './response-schema';
export * from './request-schema';
export * from './response-schema';
export type MockSchema = {
reqSchema: MockRequestSchema;
resSchema: MockResponseSchema;
};
export type MockMatchResult = {
mockSchema: MockSchema;
req: Request;
params: Record<string, string>;
};
export declare function buildMockSchema(reqSchema: MockRequestSchemaInit, resSchema: MockResponseSchemaInit): MockSchema;
//# sourceMappingURL=index.d.ts.map