The body as text. An alias for text, for when the body is a rendered page.
The body as data: parsed when it is a JSON string, returned as-is when it is already a value.
The body as text.
This is what a frontend app answers with: a rendered page is an HTML string, so an integration
test asserts on it directly. For querying that HTML rather than matching it, parse it with
whatever you already use (happy-dom, jsdom, Testing Library) — there is no assertion library
here, on purpose.
An outgoing response with the readers a test always needs.
contentis the wire payload: a JSON string for an API, an HTML string for a rendered page. Every project ends up writing the sameJSON.parse(response.content)helper; these are that helper, once, for both kinds of application.