UNPKG

cypress-maildev

Version:

An easy-to-use cypress bunch of commands to use Maildev API for tests messages reception !

18 lines (17 loc) 764 B
export interface RequestConstructorParams { baseUrl: string; } export type Method = "POST" | "GET" | "PUT" | "DELETE"; export default class Request { baseUrl: string; headers: { [key: string]: string; }; constructor({ baseUrl }: RequestConstructorParams); buildOptions(method: Method, path: string): Partial<Cypress.RequestOptions>; request<T>(method: Method, path: string, body?: Pick<Cypress.RequestOptions, "body">): Cypress.Chainable<T>; get<T>(path: string): Cypress.Chainable<T>; post<T>(path: string, body: Pick<Cypress.RequestOptions, "body">): Cypress.Chainable<T>; put<T>(path: string, body: Pick<Cypress.RequestOptions, "body">): Cypress.Chainable<T>; delete<T>(path: string): Cypress.Chainable<T>; }