Loading test/spec/request-test.js +17 −15 Original line number Original line Diff line number Diff line Loading @@ -105,9 +105,7 @@ describe('Request-Promise', function () { var expectedOptions = { var expectedOptions = { uri: 'http://localhost:1/200', uri: 'http://localhost:1/200', simple: true, simple: true, resolveWithFullResponse: false, resolveWithFullResponse: false tunnel: false, callback: undefined }; }; rp('http://localhost:1/200') rp('http://localhost:1/200') Loading @@ -116,7 +114,8 @@ describe('Request-Promise', function () { }) }) .catch(function (reason) { .catch(function (reason) { expect(reason).to.be.an('object'); expect(reason).to.be.an('object'); expect(reason.error.message).to.eql('connect ECONNREFUSED'); expect(reason.error.message).to.contain('connect ECONNREFUSED'); delete reason.options.callback; // Even out Request version differences. expect(reason.options).to.eql(expectedOptions); expect(reason.options).to.eql(expectedOptions); expect(reason.response).to.eql(undefined); expect(reason.response).to.eql(undefined); expect(reason.statusCode).to.eql(undefined); expect(reason.statusCode).to.eql(undefined); Loading @@ -131,9 +130,7 @@ describe('Request-Promise', function () { var expectedOptions = { var expectedOptions = { uri: 'http://localhost:4000/404', uri: 'http://localhost:4000/404', simple: true, simple: true, resolveWithFullResponse: false, resolveWithFullResponse: false tunnel: false, callback: undefined }; }; rp('http://localhost:4000/404') rp('http://localhost:4000/404') Loading @@ -143,6 +140,7 @@ describe('Request-Promise', function () { .catch(function (reason) { .catch(function (reason) { expect(reason).to.be.an('object'); expect(reason).to.be.an('object'); expect(reason.error).to.eql('GET /404'); expect(reason.error).to.eql('GET /404'); delete reason.options.callback; // Even out Request version differences. expect(reason.options).to.eql(expectedOptions); expect(reason.options).to.eql(expectedOptions); expect(reason.response).to.be.an('object'); expect(reason.response).to.be.an('object'); expect(reason.response.body).to.eql('GET /404'); expect(reason.response.body).to.eql('GET /404'); Loading Loading @@ -411,6 +409,8 @@ describe('Request-Promise', function () { }); }); if (process.env.V_REQUEST !== '2.34.0') { // Was never supported in this version so fixing it wouldn't make sense. it('for cascading overwrites', function () { it('for cascading overwrites', function () { var nonSimpleRP = rp.defaults({ simple: false }); var nonSimpleRP = rp.defaults({ simple: false }); Loading @@ -423,6 +423,8 @@ describe('Request-Promise', function () { }); }); } it('and not interfere with the original Request-Promise instance', function () { it('and not interfere with the original Request-Promise instance', function () { var rpWithFullResp = rp.defaults({ resolveWithFullResponse: true }); var rpWithFullResp = rp.defaults({ resolveWithFullResponse: true }); Loading Loading
test/spec/request-test.js +17 −15 Original line number Original line Diff line number Diff line Loading @@ -105,9 +105,7 @@ describe('Request-Promise', function () { var expectedOptions = { var expectedOptions = { uri: 'http://localhost:1/200', uri: 'http://localhost:1/200', simple: true, simple: true, resolveWithFullResponse: false, resolveWithFullResponse: false tunnel: false, callback: undefined }; }; rp('http://localhost:1/200') rp('http://localhost:1/200') Loading @@ -116,7 +114,8 @@ describe('Request-Promise', function () { }) }) .catch(function (reason) { .catch(function (reason) { expect(reason).to.be.an('object'); expect(reason).to.be.an('object'); expect(reason.error.message).to.eql('connect ECONNREFUSED'); expect(reason.error.message).to.contain('connect ECONNREFUSED'); delete reason.options.callback; // Even out Request version differences. expect(reason.options).to.eql(expectedOptions); expect(reason.options).to.eql(expectedOptions); expect(reason.response).to.eql(undefined); expect(reason.response).to.eql(undefined); expect(reason.statusCode).to.eql(undefined); expect(reason.statusCode).to.eql(undefined); Loading @@ -131,9 +130,7 @@ describe('Request-Promise', function () { var expectedOptions = { var expectedOptions = { uri: 'http://localhost:4000/404', uri: 'http://localhost:4000/404', simple: true, simple: true, resolveWithFullResponse: false, resolveWithFullResponse: false tunnel: false, callback: undefined }; }; rp('http://localhost:4000/404') rp('http://localhost:4000/404') Loading @@ -143,6 +140,7 @@ describe('Request-Promise', function () { .catch(function (reason) { .catch(function (reason) { expect(reason).to.be.an('object'); expect(reason).to.be.an('object'); expect(reason.error).to.eql('GET /404'); expect(reason.error).to.eql('GET /404'); delete reason.options.callback; // Even out Request version differences. expect(reason.options).to.eql(expectedOptions); expect(reason.options).to.eql(expectedOptions); expect(reason.response).to.be.an('object'); expect(reason.response).to.be.an('object'); expect(reason.response.body).to.eql('GET /404'); expect(reason.response.body).to.eql('GET /404'); Loading Loading @@ -411,6 +409,8 @@ describe('Request-Promise', function () { }); }); if (process.env.V_REQUEST !== '2.34.0') { // Was never supported in this version so fixing it wouldn't make sense. it('for cascading overwrites', function () { it('for cascading overwrites', function () { var nonSimpleRP = rp.defaults({ simple: false }); var nonSimpleRP = rp.defaults({ simple: false }); Loading @@ -423,6 +423,8 @@ describe('Request-Promise', function () { }); }); } it('and not interfere with the original Request-Promise instance', function () { it('and not interfere with the original Request-Promise instance', function () { var rpWithFullResp = rp.defaults({ resolveWithFullResponse: true }); var rpWithFullResp = rp.defaults({ resolveWithFullResponse: true }); Loading