本文整理汇总了TypeScript中@tsed/core.decoratorArgs函数的典型用法代码示例。如果您正苦于以下问题:TypeScript decoratorArgs函数的具体用法?TypeScript decoratorArgs怎么用?TypeScript decoratorArgs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decoratorArgs函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should add the middleware on the use stack", () => {
// WHEN
UseAuth(Guard, {
security: [
{
"auth": ["email"]
}
],
responses: {
"200": {
description: "Success"
}
}
})(...decoratorArgs(prototypeOf(Test), "test"));
// THEN
const store = Store.from(...decoratorArgs(prototypeOf(Test), "test"));
EndpointRegistry.useBefore.should.be.calledWithExactly(prototypeOf(Test), "test", [Guard]);
store.get("operation").should.deep.eq({
security: [
{
"auth": ["email"]
}
]
});
store.get("responses").should.deep.eq({
"200": {
description: "Success"
}
});
store.set("operation", {});
store.set("responses", {});
});
示例2: it
it("should throw an error", () => {
const args = decoratorArgs(Test, "test");
const fn = Name("name");
expect(() => fn(...args)).to.throw();
});
示例3: before
before(() => {
const args = decoratorArgs(prototypeOf(Test), "test");
Description("description")(...args);
this.store = Store.from(...args);
});
示例4: before
before(() => {
this.endpointRegistryStub = Sinon.stub(EndpointRegistry, "use");
this.returns = Use(() => {
})(...decoratorArgs(Test, "test"));
});