diff --git a/lib/reporters/mini.js b/lib/reporters/mini.js index 186a02f..4c5d258 100644 --- a/lib/reporters/mini.js +++ b/lib/reporters/mini.js @@ -106,7 +106,7 @@ MiniReporter.prototype.finish = function () { var description; if (test.error) { - description = ' ' + test.error.message + '\n ' + test.error.stack; + description = ' ' + test.error.message + '\n ' + stripFirstLine(test.error.stack); } else { description = JSON.stringify(test); } @@ -219,3 +219,7 @@ function eraseLines(count) { return clear; } + +function stripFirstLine(message) { + return message.replace(/^[^\n]*\n/, ''); +} diff --git a/test/cli.js b/test/cli.js index bc7aee1..9856d5a 100644 --- a/test/cli.js +++ b/test/cli.js @@ -92,7 +92,7 @@ test('throwing a anonymous function will report the function to the console', fu test('log failed tests', function (t) { execCli('fixture/one-pass-one-fail.js', function (err, stdout, stderr) { t.ok(err); - t.match(stderr, /AssertionError: false == true/); + t.match(stderr, /false == true/); t.end(); }); }); diff --git a/test/reporters/mini.js b/test/reporters/mini.js index 40a6e08..db27e1e 100644 --- a/test/reporters/mini.js +++ b/test/reporters/mini.js @@ -189,8 +189,7 @@ test('results with errors', function (t) { t.is(output[2], ''); t.is(output[3], ' ' + chalk.red('1. failed')); t.match(output[4], /failure/); - t.match(output[5], /Error: failure/); - t.match(output[6], /test\/reporters\/mini\.js/); + t.match(output[5], /test\/reporters\/mini\.js/); t.end(); });