Add tests for pre, meta, and options

This commit is contained in:
Tiger Oakes 2019-02-05 14:16:16 -08:00
parent 8e29287b79
commit 7a7ee210a1

View File

@ -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);