We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a need for extracting the response body (for grabbing returned state), but this feel quite wrong to do:
expect(foo, 'to yield exchange', {...}) .then(function (exchange) { var body = JSON.parse(exchange.httpExchange.response._rawBody.toString('utf-8')); ... })
There wouldn't be a better way of doing this somewhere?
The text was updated successfully, but these errors were encountered:
Hey Morten, long time no see! Are you dropping by Copenhagen.js tomorrow?
Hmm, if it's an application/json response body, then httpExchange.response.body is supposed to contain the deserialized JSON:
application/json
httpExchange.response.body
const { httpExchange: { response: { body } } } = await expect(app, 'to yield exchange satisfying', { ... });
The httpExchange object is a messy.HttpExchange instance, but it's not terribly well documented, hah: https://github.com/papandreou/messy
httpExchange
messy.HttpExchange
Sorry, something went wrong.
No branches or pull requests
I have a need for extracting the response body (for grabbing returned state), but this feel quite wrong to do:
There wouldn't be a better way of doing this somewhere?
The text was updated successfully, but these errors were encountered: