Browse Source

Merge pull request #530 from naptowncode/clean_up_redudant_assertion_error_output

Removed redundant line from assertion error output in mini reporter
babel-plugin-for-integration-tests
Sindre Sorhus 9 years ago
parent
commit
b76f840873
  1. 6
      lib/reporters/mini.js
  2. 2
      test/cli.js
  3. 3
      test/reporters/mini.js

6
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/, '');
}

2
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();
});
});

3
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();
});

Loading…
Cancel
Save