koa-lite/test/context/state.js

24 lines
429 B
JavaScript
Raw Normal View History

'use strict';
const request = require('supertest');
const assert = require('assert');
2015-10-13 06:19:42 +00:00
const Koa = require('../..');
describe('ctx.state', function() {
it('should provide a ctx.state namespace', function(done) {
2015-10-13 06:19:42 +00:00
const app = new Koa();
app.use(function *() {
assert.deepEqual(this.state, {});
});
const server = app.listen();
request(server)
.get('/')
.expect(404)
.end(done);
})
})