koa-lite/test/context/state.js
2015-10-11 16:08:32 -07:00

23 lines
415 B
JavaScript

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