koa-lite/test/response/inspect.js
broucz 4b1a1da652 test: switch all functions to arrow functions
closes 

Update test: application -> use() should throw if not a function

Fix lint

Use arrow function

Refactor test using arrow function

Remove non mandatory brackets

fix for merge

Fix: missing refactor after merge

Use arrow function for old generator
2015-11-02 11:22:05 -08:00

31 lines
682 B
JavaScript

'use strict';
const response = require('../helpers/context').response;
const assert = require('assert');
describe('res.inspect()', () => {
describe('with no response.res present', () => {
it('should return null', () => {
const res = response();
res.body = 'hello';
delete res.res;
assert(null == res.inspect());
});
});
it('should return a json representation', () => {
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'
}
});
});
});