unmock-core
Version:
[][npmjs] [](https://circleci.com/gh/unmock/unmock-js) [](h
108 lines • 7.71 kB
TypeScript
import { SinonMatcher } from "sinon";
import { ServiceSpy } from "..";
import { HTTPMethod, IIncomingHeaders, IIncomingQuery, IOutgoingHeaders, IProtocol } from "../../../interfaces";
export interface ISpyDecoration {
with(matcher: SinonMatcher): ServiceSpy;
withMethod(method: HTTPMethod): ServiceSpy;
postRequestHost(matcher?: SinonMatcher): string;
postRequestBody(matcher?: SinonMatcher): string | undefined;
postRequestBodyAsJson(matcher?: SinonMatcher): any;
postRequestPathname(matcher?: SinonMatcher): string;
postRequestPath(matcher?: SinonMatcher): string;
postRequestHeaders(matcher?: SinonMatcher): IIncomingHeaders;
postRequestQuery(matcher?: SinonMatcher): IIncomingQuery;
postRequestProtocol(matcher?: SinonMatcher): IProtocol;
postResponseBody(matcher?: SinonMatcher): string | undefined;
postResponseBodyAsJson(matcher?: SinonMatcher): any;
postResponseCode(matcher?: SinonMatcher): number;
postResponseHeaders(matcher?: SinonMatcher): IOutgoingHeaders;
getRequestHost(matcher?: SinonMatcher): string;
getRequestBody(matcher?: SinonMatcher): string | undefined;
getRequestBodyAsJson(matcher?: SinonMatcher): any;
getRequestPathname(matcher?: SinonMatcher): string;
getRequestPath(matcher?: SinonMatcher): string;
getRequestHeaders(matcher?: SinonMatcher): IIncomingHeaders;
getRequestQuery(matcher?: SinonMatcher): IIncomingQuery;
getRequestProtocol(matcher?: SinonMatcher): IProtocol;
getResponseBody(matcher?: SinonMatcher): string | undefined;
getResponseBodyAsJson(matcher?: SinonMatcher): any;
getResponseCode(matcher?: SinonMatcher): number;
getResponseHeaders(matcher?: SinonMatcher): IOutgoingHeaders;
putRequestHost(matcher?: SinonMatcher): string;
putRequestBody(matcher?: SinonMatcher): string | undefined;
putRequestBodyAsJson(matcher?: SinonMatcher): any;
putRequestPathname(matcher?: SinonMatcher): string;
putRequestPath(matcher?: SinonMatcher): string;
putRequestHeaders(matcher?: SinonMatcher): IIncomingHeaders;
putRequestQuery(matcher?: SinonMatcher): IIncomingQuery;
putRequestProtocol(matcher?: SinonMatcher): IProtocol;
putResponseBody(matcher?: SinonMatcher): string | undefined;
putResponseBodyAsJson(matcher?: SinonMatcher): any;
putResponseCode(matcher?: SinonMatcher): number;
putResponseHeaders(matcher?: SinonMatcher): IOutgoingHeaders;
deleteRequestHost(matcher?: SinonMatcher): string;
deleteRequestBody(matcher?: SinonMatcher): string | undefined;
deleteRequestBodyAsJson(matcher?: SinonMatcher): any;
deleteRequestPathname(matcher?: SinonMatcher): string;
deleteRequestPath(matcher?: SinonMatcher): string;
deleteRequestHeaders(matcher?: SinonMatcher): IIncomingHeaders;
deleteRequestQuery(matcher?: SinonMatcher): IIncomingQuery;
deleteRequestProtocol(matcher?: SinonMatcher): IProtocol;
deleteResponseBody(matcher?: SinonMatcher): string | undefined;
deleteResponseBodyAsJson(matcher?: SinonMatcher): any;
deleteResponseCode(matcher?: SinonMatcher): number;
deleteResponseHeaders(matcher?: SinonMatcher): IOutgoingHeaders;
}
export declare const decorators: {
with(this: ServiceSpy, matcher: SinonMatcher): ServiceSpy;
withMethod(this: ServiceSpy, method: import("openapi-refinements").MethodNames): ServiceSpy;
postRequestHost(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
postRequestBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
postRequestBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
postRequestPath(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
postRequestPathname(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
postRequestHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingHeaders;
postRequestQuery(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingQuery;
postRequestProtocol(this: ServiceSpy, matcher?: SinonMatcher | undefined): IProtocol;
postResponseBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
postResponseBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
postResponseCode(this: ServiceSpy, matcher?: SinonMatcher | undefined): number;
postResponseHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IOutgoingHeaders;
getRequestHost(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
getRequestBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
getRequestBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
getRequestPath(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
getRequestPathname(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
getRequestHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingHeaders;
getRequestQuery(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingQuery;
getRequestProtocol(this: ServiceSpy, matcher?: SinonMatcher | undefined): IProtocol;
getResponseBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
getResponseBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
getResponseCode(this: ServiceSpy, matcher?: SinonMatcher | undefined): number;
getResponseHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IOutgoingHeaders;
putRequestHost(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
putRequestBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
putRequestBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
putRequestPath(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
putRequestPathname(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
putRequestHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingHeaders;
putRequestQuery(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingQuery;
putRequestProtocol(this: ServiceSpy, matcher?: SinonMatcher | undefined): IProtocol;
putResponseBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
putResponseBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
putResponseCode(this: ServiceSpy, matcher?: SinonMatcher | undefined): number;
putResponseHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IOutgoingHeaders;
deleteRequestHost(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
deleteRequestBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
deleteRequestBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
deleteRequestPath(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
deleteRequestPathname(this: ServiceSpy, matcher?: SinonMatcher | undefined): string;
deleteRequestHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingHeaders;
deleteRequestQuery(this: ServiceSpy, matcher?: SinonMatcher | undefined): IIncomingQuery;
deleteRequestProtocol(this: ServiceSpy, matcher?: SinonMatcher | undefined): IProtocol;
deleteResponseBody(this: ServiceSpy, matcher?: SinonMatcher | undefined): string | undefined;
deleteResponseBodyAsJson(this: ServiceSpy, matcher?: SinonMatcher | undefined): any;
deleteResponseCode(this: ServiceSpy, matcher?: SinonMatcher | undefined): number;
deleteResponseHeaders(this: ServiceSpy, matcher?: SinonMatcher | undefined): IOutgoingHeaders;
};
//# sourceMappingURL=index.d.ts.map