feature #239: add enumeration style object for error codes

This commit is contained in:
Sefa Ilkimen
2019-09-26 03:00:30 +02:00
parent 4b73c3762c
commit 2ce1fc407d
5 changed files with 24 additions and 4 deletions
+4
View File
@@ -147,6 +147,10 @@ describe('Advanced HTTP public interface', function () {
it('throws an Error when you try to configure global option for following redirects with a string', () => {
(function () { http.setFollowRedirect('myString'); }).should.throw(messages.INVALID_FOLLOW_REDIRECT_VALUE);
});
it('exposes an enumeration style object with mappings for the error codes', () => {
Object.keys(http.ErrorCode).forEach(key => http.ErrorCode[key].should.be.a('number'));
});
});
describe('URL util', function () {