28 lines
636 B
JavaScript
28 lines
636 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const testBase = require('../../test-base');
|
||
|
const errors = require('errors');
|
||
|
const expect = testBase.expect;
|
||
|
|
||
|
suite('Controller tests', () => {
|
||
|
let controller = null;
|
||
|
|
||
|
setup(() => {
|
||
|
controller = testBase.requireNoCache('app/base/Controller');
|
||
|
});
|
||
|
|
||
|
suite('HttpError Tests', () => {
|
||
|
test('500 Error', (done) => {
|
||
|
controller.HttpError(500, (err) => {
|
||
|
expect(err).to.deep.equal(new errors.Http500Error());
|
||
|
return done();
|
||
|
});
|
||
|
});
|
||
|
test('401 Error', (done) => {
|
||
|
controller.HttpError(401, (err) => {
|
||
|
expect(err).to.deep.equal(new errors.Http401Error());
|
||
|
return done();
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
});
|