mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add tests for pre, meta, and options
This commit is contained in:
parent
8e29287b79
commit
7a7ee210a1
@ -30,6 +30,7 @@ const spec3: router.Spec = {
|
||||
body: Joi.any(),
|
||||
},
|
||||
handler: (ctx: koa.Context) => ctx.status = 201,
|
||||
pre: (_ctx, next) => next(),
|
||||
};
|
||||
|
||||
router().route(spec3);
|
||||
@ -42,9 +43,12 @@ const spec4: router.Spec = {
|
||||
output: {
|
||||
201: Joi.object(),
|
||||
'400,404': Joi.object(),
|
||||
},
|
||||
jsonOptions: {
|
||||
limit: '10kb'
|
||||
}
|
||||
},
|
||||
handler: (ctx: koa.Context) => {
|
||||
handler(ctx) {
|
||||
ctx.status = 201;
|
||||
ctx.body = {};
|
||||
},
|
||||
@ -59,6 +63,7 @@ const spec5: router.Spec = {
|
||||
ctx.status = 201;
|
||||
ctx.body = ctx.request.body;
|
||||
},
|
||||
meta: 'meta data',
|
||||
};
|
||||
|
||||
router().route(spec5);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user