koa-lite/test/context/state.js
jongleberry 2e8cdab8bc support async functions
closes #530
closes #415
2015-10-22 16:34:59 -07:00

23 lines
430 B
JavaScript

'use strict';
const request = require('supertest');
const assert = require('assert');
const Koa = require('../..');
describe('ctx.state', function(){
it('should provide a ctx.state namespace', function(done){
const app = new Koa();
app.use(function *(ctx){
assert.deepEqual(ctx.state, {});
});
const server = app.listen();
request(server)
.get('/')
.expect(404)
.end(done);
});
});