Commit c26ffb18 authored by analog-nico's avatar analog-nico
Browse files

Fixed bugs in test code

parent 72a92792
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -105,9 +105,7 @@ describe('Request-Promise', function () {
            var expectedOptions = {
                uri: 'http://localhost:1/200',
                simple: true,
                resolveWithFullResponse: false,
                tunnel: false,
                callback: undefined
                resolveWithFullResponse: false
            };

            rp('http://localhost:1/200')
@@ -116,7 +114,8 @@ describe('Request-Promise', function () {
                })
                .catch(function (reason) {
                    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.response).to.eql(undefined);
                    expect(reason.statusCode).to.eql(undefined);
@@ -131,9 +130,7 @@ describe('Request-Promise', function () {
            var expectedOptions = {
                uri: 'http://localhost:4000/404',
                simple: true,
                resolveWithFullResponse: false,
                tunnel: false,
                callback: undefined
                resolveWithFullResponse: false
            };

            rp('http://localhost:4000/404')
@@ -143,6 +140,7 @@ describe('Request-Promise', function () {
                .catch(function (reason) {
                    expect(reason).to.be.an('object');
                    expect(reason.error).to.eql('GET /404');
                    delete reason.options.callback; // Even out Request version differences.
                    expect(reason.options).to.eql(expectedOptions);
                    expect(reason.response).to.be.an('object');
                    expect(reason.response.body).to.eql('GET /404');
@@ -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 () {

                var nonSimpleRP = rp.defaults({ simple: false });
@@ -423,6 +423,8 @@ describe('Request-Promise', function () {

            });

        }

        it('and not interfere with the original Request-Promise instance', function () {

            var rpWithFullResp = rp.defaults({ resolveWithFullResponse: true });