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

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

30 lines
732 B
JavaScript

'use strict';
const response = require('../helpers/context').response;
describe('res.message', () => {
it('should return the response status message', () => {
const res = response();
res.status = 200;
res.message.should.equal('OK');
});
describe('when res.message not present', () => {
it('should look up in statuses', () => {
const res = response();
res.res.statusCode = 200;
res.message.should.equal('OK');
});
});
});
describe('res.message=', () => {
it('should set response status message', () => {
const res = response();
res.status = 200;
res.message = 'ok';
res.res.statusMessage.should.equal('ok');
res.inspect().message.should.equal('ok');
});
});