4b1a1da652
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
30 lines
732 B
JavaScript
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');
|
|
});
|
|
});
|