From ee09301d8d78c0202579370655db30d951c2005b Mon Sep 17 00:00:00 2001 From: Sheel Choksi Date: Sun, 27 Jul 2014 18:31:47 -0700 Subject: [PATCH] Console reporter prints out failed expectation's message Previously, was only printing out the stack while the html reporter would print out the message as well as the stack. Now they should be more consistent. As noticed by @despairblue in #638 --- lib/console/console.js | 1 + spec/console/ConsoleReporterSpec.js | 1 + src/console/ConsoleReporter.js | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/console/console.js b/lib/console/console.js index c54f72da..78b56150 100644 --- a/lib/console/console.js +++ b/lib/console/console.js @@ -154,6 +154,7 @@ getJasmineRequireObj().ConsoleReporter = function() { for (var i = 0; i < result.failedExpectations.length; i++) { var failedExpectation = result.failedExpectations[i]; printNewline(); + print(indent(failedExpectation.message, 2)); print(indent(failedExpectation.stack, 2)); } diff --git a/spec/console/ConsoleReporterSpec.js b/spec/console/ConsoleReporterSpec.js index 0957039b..b19f51c6 100644 --- a/spec/console/ConsoleReporterSpec.js +++ b/spec/console/ConsoleReporterSpec.js @@ -173,6 +173,7 @@ describe("ConsoleReporter", function() { reporter.jasmineDone({}); + expect(out.getOutput()).toMatch(/true to be false/); expect(out.getOutput()).toMatch(/foo bar baz/); }); diff --git a/src/console/ConsoleReporter.js b/src/console/ConsoleReporter.js index 426c431f..a3895f45 100644 --- a/src/console/ConsoleReporter.js +++ b/src/console/ConsoleReporter.js @@ -119,6 +119,7 @@ getJasmineRequireObj().ConsoleReporter = function() { for (var i = 0; i < result.failedExpectations.length; i++) { var failedExpectation = result.failedExpectations[i]; printNewline(); + print(indent(failedExpectation.message, 2)); print(indent(failedExpectation.stack, 2)); }