mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-05-20 03:04:37 +00:00
Add tests for pre, meta, and options
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user