You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that the update to supertest/superagent(depenency) from major version 2 to 3 has caused the body part of the supersamples report to change from being json formated to a single escaped string.
I'm probable not as familiar with this as you but the superagent response does not have body so I tried this hack
function extractResponse(superTest, response) {
if (!superTest.res.body) {
console.log('no body on the supertest response');
console.log(`but the text was ${superTest.res.text}`);
} else {
console.log('was a body');
}
const headers = responseHeaders(superTest, response);
console.log(`headers are ....=======> ${JSON.stringify(headers)}`);
// headers.forEach(h => console.log(`${h}`));
return {
status: response.status,
headers: headers,
body: superTest.res.body || JSON.parse(superTest.res.text)
};
}```
The text was updated successfully, but these errors were encountered:
I believe that the update to supertest/superagent(depenency) from major version 2 to 3 has caused the body part of the supersamples report to change from being json formated to a single escaped string.
This is what is seen if you use supertest 3.0.0
whereas if supertest 2.0.0 is used you see
I have a simple repo to demonstrate the issue https://github.com/ghinks/supersamples-json-issue.git
I'm happy to lend a hand sorting it out too :)
node version 4.2.6
I'm probable not as familiar with this as you but the superagent response does not have body so I tried this hack
The text was updated successfully, but these errors were encountered: