Skip to content

Commit

Permalink
Support compact output for multiple levels of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed May 18, 2015
1 parent 2c423a9 commit 903eca5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/UnexpectedError.js
Expand Up @@ -57,18 +57,18 @@ UnexpectedError.prototype.getDefaultErrorMessage = function (compact) {
return message;
};

UnexpectedError.prototype.getNestedErrorMessage = function () {
UnexpectedError.prototype.getNestedErrorMessage = function (compact) {
var message = this.expect.output.clone();
var compact = this.parent && this.parent.subject === this.subject;
if (this.assertion) {
message.append(this.assertion.standardErrorMessage());
} else {
message.append(this.output);
}

var parentCompact = this.parent && this.parent.subject === this.subject;
message.nl()
.indentLines()
.i().block(this.parent.getErrorMessage(compact));
.i().block(this.parent.getErrorMessage(parentCompact));
return message;
};

Expand Down

0 comments on commit 903eca5

Please sign in to comment.