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

Refactor Fetchr Tests #143

Merged
merged 1 commit into from
May 5, 2016
Merged

Refactor Fetchr Tests #143

merged 1 commit into from
May 5, 2016

Conversation

Vijar
Copy link
Contributor

@Vijar Vijar commented May 5, 2016

A preview of whats to come.

Fixes #141

@yahoocla
Copy link

yahoocla commented May 5, 2016

CLA is valid!

@coveralls
Copy link

coveralls commented May 5, 2016

Coverage Status

Coverage increased (+0.7%) to 96.522% when pulling 207305d on testing into 4886de2 on master.

@coveralls
Copy link

coveralls commented May 5, 2016

Coverage Status

Coverage increased (+0.7%) to 96.522% when pulling beebb55 on testing into 4886de2 on master.

@Vijar
Copy link
Contributor Author

Vijar commented May 5, 2016

@redonkulus @mridgway @lingyan this is ready for merge.

@@ -335,7 +335,14 @@ Fetcher.middleware = function (options) {
}
if (err) {
var errResponse = getErrorResponse(err);
res.status(errResponse.statusCode).json(responseFormatter(req, res, errResponse.output));
if (req.query && req.query.returnMeta) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vijar can you explain this part? will this break responseFormatter since output is not passed in directly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we are fine. We are already doing req.query.returnMeta logic branching on line 348 below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we were doing this for normal requests but not for error requests so its kind of a bug.

@Vijar Vijar changed the title [WIP] Refactor Fetchr Tests Refactor Fetchr Tests May 5, 2016
@@ -193,6 +193,10 @@ function io(url, options) {
err = new Error(errMessage);
err.statusCode = status;
err.body = errBody || body;
if (err.body) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a deprecate warning in the next release for body?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why we can't keep both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update docs to make sure only one is mentioned?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't even have docs on handling errors, but I just added some.

@coveralls
Copy link

coveralls commented May 5, 2016

Coverage Status

Coverage increased (+0.7%) to 96.522% when pulling 54281e2 on testing into 4886de2 on master.

@redonkulus
Copy link
Contributor

👍

@coveralls
Copy link

coveralls commented May 5, 2016

Coverage Status

Coverage increased (+0.7%) to 96.522% when pulling 6664cad on testing into 45036dd on master.

@lingyan
Copy link
Member

lingyan commented May 5, 2016

👍

@Vijar Vijar merged commit d972790 into master May 5, 2016
@Vijar Vijar deleted the testing branch May 5, 2016 20:58
@Vijar Vijar removed the in progress label May 5, 2016
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.

5 participants