本文整理汇总了TypeScript中chakram.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should handle errors in custom middlewares", () => {
return chakram
.get("http://127.0.0.1:3001/customMiddlewareWichThrows")
.then((response: any) => {
expect(response).to.have.status(406);
});
});
示例2: it
it("should use a custom middleware when @UseBefore or @UseAfter is used", () => {
return chakram
.get("http://127.0.0.1:3001/questions")
.then((response: any) => {
expect(useCustom).to.be.equal(true);
expect(response).to.have.status(200);
});
});
示例3: it
it("should call global error handler middleware", () => {
return chakram
.get("http://127.0.0.1:3001/videos")
.then((response: any) => {
expect(errorHandlerCalled).to.be.true;
expect(response).to.have.status(404);
});
});
示例4: it
it("should not execute next middleware if soft error handled specifically and stopped error bubbling", () => {
return chakram
.get("http://127.0.0.1:3001/files")
.then((response: any) => {
expect(errorHandlerCalled).to.be.empty;
expect(errorHandledSpecifically).to.be.empty;
expect(response).to.have.status(500);
});
});