e8f79d43f9
closes #517 add index test for Application add app.toJSON test add test for app.inspect() add tests for app.use() add tests for app.onerror() add tests for app.respond() add tests for app.context() add tests for app.request() add tests for app.response refactor for non-existence of test/app...js no need for *.js use helpers/ dir for non-tests
31 lines
694 B
JavaScript
31 lines
694 B
JavaScript
|
|
'use strict';
|
|
|
|
const response = require('../helpers/context').response;
|
|
const assert = require('assert');
|
|
|
|
describe('res.inspect()', function(){
|
|
describe('with no response.res present', function(){
|
|
it('should return null', function(){
|
|
const res = response();
|
|
res.body = 'hello';
|
|
delete res.res;
|
|
assert(null == res.inspect());
|
|
})
|
|
})
|
|
|
|
it('should return a json representation', function(){
|
|
const res = response();
|
|
res.body = 'hello';
|
|
|
|
res.inspect().should.eql({
|
|
body: 'hello',
|
|
status: 200,
|
|
message: 'OK',
|
|
header: {
|
|
'content-length': '5',
|
|
'content-type': 'text/plain; charset=utf-8'
|
|
}
|
|
});
|
|
})
|
|
})
|