Skip to content

Commit

Permalink
Restore TAP failure message and stack traces in a TAP version 13-comp…
Browse files Browse the repository at this point in the history
…liant way
  • Loading branch information
putermancer committed Dec 29, 2017
1 parent af786f6 commit 1cd083e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tap_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
}

self.jasmineStarted = function(summary) {
log("TAP version 13");
self.started = true;
totalSpecsDefined = summary && summary.totalSpecsDefined || NaN;
startTime = exportObject.startTime = new Date();
Expand All @@ -93,6 +94,15 @@
if (isFailed(spec)) {
totalSpecsFailed++;
resultStr = "not " + resultStr;
for (var i = 0, failure; i < spec.failedExpectations.length; i++) {
failure = spec.failedExpectations[i];
resultStr += "\n # Failure: " + trim(failure.message);
if (failure.stack && failure.stack !== failure.message) {
resultStr += "\n # === STACK TRACE ===";
resultStr += "\n # " + failure.stack.replace(/\n/mg, "\n # ");
resultStr += "\n # === END STACK TRACE ===";
}
}
}
if (isSkipped(spec)) {
totalSpecsSkipped++;
Expand Down

0 comments on commit 1cd083e

Please sign in to comment.