From 7a7ee210a16dcfb3b769cf3e60fc0caffb7953cd Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Tue, 5 Feb 2019 14:16:16 -0800 Subject: [PATCH] Add tests for pre, meta, and options --- types/koa-joi-router/koa-joi-router-tests.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/koa-joi-router/koa-joi-router-tests.ts b/types/koa-joi-router/koa-joi-router-tests.ts index 67340a5a8d..160c3834c1 100644 --- a/types/koa-joi-router/koa-joi-router-tests.ts +++ b/types/koa-joi-router/koa-joi-router-tests.ts @@ -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);