Browse Source

Merge pull request #205 from jamestalmage/regression-one-passing-one-failing

regression: logger throws on files with both passing and failing tests.
babel-plugin-for-integration-tests
Sindre Sorhus 9 years ago
parent
commit
fc9a1dcafb
  1. 2
      lib/logger.js
  2. 11
      test/fixture/one-pass-one-fail.js
  3. 12
      test/test.js

2
lib/logger.js

@ -58,7 +58,7 @@ x.errors = function (results) {
var i = 0;
results.forEach(function (result) {
if (!result.error) {
if (!(result.error && result.error.message)) {
return;
}

11
test/fixture/one-pass-one-fail.js

@ -0,0 +1,11 @@
const test = require('../../');
test('this is a passing test', t => {
t.ok(true);
t.end();
});
test('this is a failing test', t => {
t.ok(false);
t.end();
});

12
test/test.js

@ -1075,3 +1075,15 @@ test('absolute paths in CLI', function (t) {
t.end();
});
});
test('titles of both passing and failing tests and AssertionErrors are displayed', function (t) {
t.plan(4);
execCli('fixture/one-pass-one-fail.js', function (err, stdout, stderr) {
t.ok(err);
t.ok(/this is a passing test/.test(stderr));
t.ok(/this is a failing test/.test(stderr));
t.ok(/AssertionError/.test(stderr));
t.end();
});
});

Loading…
Cancel
Save