Skip to content

Commit

Permalink
Merge 598b3c8 into ca4e958
Browse files Browse the repository at this point in the history
  • Loading branch information
anishkny committed Jul 22, 2018
2 parents ca4e958 + 598b3c8 commit 702fdc0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/mocha-axios-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ function MochaAxiosReporter(runner) {
fs.appendFileSync(NETWORK_DUMP_FILE, resDump);
return response;
}, async (error) => {
const resDump = '```\n' +
`${error.response.status} ${error.response.statusText}\n\n` +
JSON.stringify(error.response.data, null, 2) + '\n' +
'```\n';
fs.appendFileSync(NETWORK_DUMP_FILE, resDump);
if (error && error.response && error.response.status &&
error.response.statusText) {
const resDump = '```\n' +
`${error.response.status} ${error.response.statusText}\n\n` +
JSON.stringify(error.response.data, null, 2) + '\n' +
'```\n';
fs.appendFileSync(NETWORK_DUMP_FILE, resDump);
}
return Promise.reject(error);
});

Expand Down

0 comments on commit 702fdc0

Please sign in to comment.