e2ed
Version:
E2E testing framework over Playwright
11 lines (10 loc) • 689 B
TypeScript
import type { ApiMockFunction, ApiRouteClassTypeWithGetParamsFromUrl, Request, Response } from '../../types/internal';
/**
* Mock API for some API route.
* Applicable only for routes with the `getParamsFromUrlOrThrow` method.
* The mock is applied to a request that matches the route by url
* (by methods `getParamsFromUrlOrThrow` and `isMatchUrl`).
*/
export declare const mockApiRoute: <RouteParams, SomeRequest extends Request, SomeResponse extends Response>(Route: ApiRouteClassTypeWithGetParamsFromUrl<RouteParams, SomeRequest, SomeResponse>, apiMockFunction: ApiMockFunction<RouteParams, SomeRequest, SomeResponse>, { skipLogs }?: {
skipLogs?: boolean;
}) => Promise<void>;