forwardemail / forwardemail/supertest

Supertest should report response body on error

Open
#631 2 comments 18 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

Since #95 got closed 6 years ago and there seems to be no incentive to reopen this, here's an almost 1:1 copy of that issue, but instead of reporting the hard coded `.error` property, imo the entire response body should be printed out, as currently the server response is disregarded completely.

---

> At the moment when the status message does not match the expectations we get an error message like:
`expected 200 "OK, got 500 Internal server error`
It would be helpful to display a server custom error message if any, as defined by:
`res.send(500, { error: 'something blew up' });`
would display:
`expected 200 "OK", got 500 with response "{ error: 'something blew up' }"`

---

> +1, but maybe we should just add the contents of res.body. It should contain the relevant error messages that would help devs figure out what the errors are.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.