0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Fixed handing test suite

no issue

- The response from the server might not always contain an array with errors (for example when there's a generic 503 error). This changes prevents tests from hanging and adds at least some relevant output
This commit is contained in:
Naz 2021-12-09 13:52:02 +04:00
parent 307e4c2643
commit af8387d1f4

View file

@ -105,7 +105,7 @@ const login = (request, API_URL) => {
}));
} else if (res.statusCode !== 200 && res.statusCode !== 201) {
return reject(new errors.InternalServerError({
message: res.body.errors[0].message
message: _.get(res, 'body.errors[0].message') || res.error.message
}));
}