Skip to content

Commit

Permalink
feat: add lifecyle with koa-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
npmstudy committed Oct 25, 2023
1 parent df2d9d0 commit 1ec3239
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ const log = debug('httprpc');

export const LifeCycleConfig = {
beforeAll: async (ctx, next) => {
console.log('beforeAll');
log('beforeAll');
await next();
console.log('beforeAll end');
log('beforeAll end');
},
beforeEach: async (ctx, next) => {
console.log('beforeEach');
log('beforeEach');
await next();
console.log('beforeEach end');
log('beforeEach end');
},
afterEach: async (ctx, next) => {
console.log('afterEach');
log('afterEach');
await next();
console.log('afterEach end');
log('afterEach end');
},
afterAll: async (ctx, next) => {
console.log('afterAll');
log('afterAll');
await next();
console.log('afterAll end');
log('afterAll end');
},
};

Expand Down

0 comments on commit 1ec3239

Please sign in to comment.