koa-lite/test/context/state.js
Felix Becker ebb4850709 Remove co dependency
closes #558
closes #557

Change tests to use plain functions and promises

Add test

return promise in middleware

Change benchmarks to use plain functions and promises

typeerror
2015-10-27 16:24:25 -07:00

23 lines
428 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);
});
});