Skip to content

Commit

Permalink
test: Add session handling and redirect case
Browse files Browse the repository at this point in the history
  • Loading branch information
AxiosLeo committed Aug 20, 2024
1 parent 1bfa5f4 commit ed227b8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ if (require.main === module) {
success();
});

root.get('/session', async (context) => {
context.koa.session.test = { a: 'A' };
context.koa.session.save();
context.koa.redirect('/redirect');
});

root.get('/redirect', async (context) => {
const data = JSON.stringify({
session: context.koa.session.test,
});
success(data);
});

const app = new KoaApplication({
debug: true,
routers: [root]
Expand Down

0 comments on commit ed227b8

Please sign in to comment.