@eggjs/supertest
Version:
SuperAgent driven library for testing HTTP servers
33 lines (31 loc) • 883 B
TypeScript
import { AgentOptions as AgentOptions$1, App } from "./types.js";
import { Test } from "./test.js";
import { agent } from "superagent";
import { Server } from "node:net";
//#region src/agent.d.ts
/**
* Initialize a new `TestAgent`.
*
* @param {Function|Server} app
* @param {Object} options
*/
declare class TestAgent extends agent {
#private;
app: Server | string;
_host: string;
constructor(appOrListener: App, options?: AgentOptions$1);
host(host: string): this;
protected _testRequest(method: string, url: string): Test;
delete(url: string): Test;
del(url: string): Test;
get(url: string): Test;
head(url: string): Test;
put(url: string): Test;
post(url: string): Test;
patch(url: string): Test;
options(url: string): Test;
trace(url: string): Test;
}
declare const proxyAgent: typeof TestAgent;
//#endregion
export { TestAgent, proxyAgent };