diff --git a/lib/superagent-mock.js b/lib/superagent-mock.js index c293751..0ea67b9 100755 --- a/lib/superagent-mock.js +++ b/lib/superagent-mock.js @@ -173,7 +173,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);