Skip to content

Commit

Permalink
Hide output for expected&actual if both are undefined (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 authored Apr 20, 2021
1 parent 0c0a7bc commit fa3d07c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/custom-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ function MochaJUnitReporter (runner, options) {
}.bind(this));

this._runner.on('fail', function (test, err) {
console.error('- expected: ', test.err && test.err.expected);
console.error('+ actual: ', test.err && test.err.actual);
if ((test.err && test.err.expected !== undefined) || (test.err && test.err.actual !== undefined)) {
console.error('- expected: ', test.err && test.err.expected);
console.error('+ actual: ', test.err && test.err.actual);
}
console.error(test.err && test.err.codeFrame && test.err.codeFrame.frame);
console.error(test.err.message);
sauceJson.push(this.getSauceTestcaseData(test));
Expand Down

0 comments on commit fa3d07c

Please sign in to comment.