Add tests for BaseContext as well as Context

This commit is contained in:
Dave Wasmer
2018-05-24 13:24:24 -06:00
committed by GitHub
parent 4ba9fb918f
commit e711b702bf

View File

@@ -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) => {