UNPKG

cypress-mailosaur

Version:

Extends Cypress' cy commands that let you integrate email and SMS testing into your continuous integration process.

40 lines (39 loc) 1.32 kB
type RequestHeaders = { Accept: string; Authorization: string; 'User-Agent': string; }; interface RequestInitOptions { baseUrl?: string; apiKey?: string; } interface RequestOptions extends Record<string, unknown> { method: string; url: string; headers: RequestHeaders; encoding?: string; qs?: Record<string, string | number | Date | undefined>; json?: unknown; body?: unknown; failOnStatusCode?: boolean; } interface CypressResponse { isOkStatusCode: boolean; status: number; body?: any; headers?: Record<string, unknown>; } declare class Request { baseUrl: string; apiKey?: string; headers: RequestHeaders; constructor(options: RequestInitOptions); buildOptions(method: string, path: string, opts?: Record<string, unknown>): RequestOptions; getResponseHandler(includeResponseMetadata?: boolean): (response: CypressResponse) => any; request(method: string, path: string, body?: unknown, opts?: Record<string, unknown>): any; get(path: string, opts?: Record<string, unknown>): any; post(path: string, body?: unknown, opts?: Record<string, unknown>): any; put(path: string, body?: unknown, opts?: Record<string, unknown>): any; del(path: string, opts?: Record<string, unknown>): any; } export default Request;