From e711b702bfbc0f080992ca3d452883fe56c65388 Mon Sep 17 00:00:00 2001 From: Dave Wasmer Date: Thu, 24 May 2018 13:24:24 -0600 Subject: [PATCH] Add tests for BaseContext as well as Context --- types/koa/koa-tests.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/koa/koa-tests.ts b/types/koa/koa-tests.ts index 2eff16857a..2ddf9b41e2 100644 --- a/types/koa/koa-tests.ts +++ b/types/koa/koa-tests.ts @@ -1,9 +1,12 @@ import Koa = require("koa"); declare module 'koa' { - export interface Context { + export interface BaseContext { db(): void; } + export interface Context { + user: {}; + } } const app = new Koa(); @@ -12,6 +15,7 @@ app.context.db = () => {}; app.use(async ctx => { console.log(ctx.db); + ctx.user = {}; }); app.use((ctx, next) => {