[errors] ensure that error.status is always a number when defined

This commit is contained in:
spalger
2016-01-05 14:25:08 -07:00
parent 964b7ae24e
commit 0e3fe1586f
2 changed files with 55 additions and 46 deletions

View File

@ -24,3 +24,11 @@ describe('Error Abstract', function () {
expect(err.stack).to.be.a('string');
});
});
describe('StatusCodeError', function () {
it('exposes status code as a number', function () {
var err = new errors['404']();
expect(err.status).to.be(404);
expect(err.status).to.not.be('404');
});
});