Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(request-helper): return new Test #197

Closed
wants to merge 1 commit into from
Closed

Fix(request-helper): return new Test #197

wants to merge 1 commit into from

Conversation

Bamieh
Copy link

@Bamieh Bamieh commented Jan 9, 2018

I was testing the master code on my company's code base, and It was not working because of this changed line of code:

return new Test(server, method, path)
   .on('end', function() {
       obj.close();
    });

This is the error:

TypeError: Cannot read property 'address' of undefined
at serverAddress (request.js)
at new Test (request.js)
at Object.obj.(anonymous function) [as get] (request.js)
at Context. (.spec.js)

I have the following setup:

global.reflowRequest = () => request(process.env.AUTOMATION_MANAGER_API);

//...

const req = reflowRequest().get(url);

return expect(req).to.eventually.be.fulfilled...

The fix proposed solved this issue for me

@Bamieh
Copy link
Author

Bamieh commented Jan 9, 2018

Closing this as it turns out the error i was getting is happening dues to not sending an app at all to the request method.

chai.request(undefined);

@Bamieh Bamieh closed this Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant