Skip to content

Commit

Permalink
Using response._setStatusProperties if available to avoid warning abo…
Browse files Browse the repository at this point in the history
…ut superagent.2.x making setStatusProperties method private
  • Loading branch information
awei01 committed Aug 23, 2016
1 parent fe05765 commit 89b35ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/superagent-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ function mock (superagent, config, logger) {
getResponseHeader: function () {return err.responseHeader || 'a header';}
}
});
response.setStatusProperties(err.message);
if (response._setStatusProperties) {
response._setStatusProperties(err.message);
} else {
response.setStatusProperties(err.message);
}
}

fn(error, response);
Expand Down

0 comments on commit 89b35ec

Please sign in to comment.