0b1b49cb8a
closes #508
23 lines
415 B
JavaScript
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);
|
|
})
|
|
})
|