2013-08-17 07:15:57 +00:00
|
|
|
|
2013-11-08 01:05:26 +00:00
|
|
|
var Context = require('../lib/context');
|
2013-08-21 04:24:18 +00:00
|
|
|
var request = require('supertest');
|
2013-08-17 07:15:57 +00:00
|
|
|
var assert = require('assert');
|
|
|
|
var koa = require('..');
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
function context(req, res) {
|
|
|
|
req = req || { headers: {} };
|
|
|
|
res = res || { _headers: {} };
|
|
|
|
res.setHeader = function(k, v){ res._headers[k.toLowerCase()] = v };
|
|
|
|
var ctx = new Context({}, req, res);
|
|
|
|
return ctx;
|
|
|
|
}
|
|
|
|
|
2013-11-13 17:01:15 +00:00
|
|
|
module.exports = context;
|