@httpc/kit
Version:
httpc toolbox for building function-based API with minimal code and end-to-end type safety
25 lines (24 loc) • 786 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationTester = void 0;
const server_1 = require("@httpc/server");
const di_1 = require("../di");
class ApplicationTester {
constructor(options) {
this.options = options;
this.server = (0, server_1.createHttpCServerTester)(options);
}
async initialize() {
await (0, di_1.initializeContainer)();
}
newCall() {
return this.server.newCall;
}
createCall(...pipeline) {
return (0, server_1.httpPipelineTester)(this.options?.middlewares, (0, server_1.httpCall)(...pipeline));
}
runCall(...pipeline) {
return this.createCall(...pipeline)();
}
}
exports.ApplicationTester = ApplicationTester;