Skip to content

Commit

Permalink
Merge pull request #1166 from testem/revert-1165-getsnoopy/mocha-doub…
Browse files Browse the repository at this point in the history
…le-failure

Revert "Fix Mocha's duplicate failure logs"
  • Loading branch information
johanneswuerbach committed Aug 11, 2017
2 parents 9d4e761 + a70eaa6 commit 3eba6a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions public/testem/mocha_adapter.js
Expand Up @@ -70,6 +70,8 @@ function mochaAdapter() {
emit('all-test-results', results);
}
}, 0);
} else if (evt === 'fail') {
testFail(test, err);
}

oEmit.apply(this, arguments);
Expand Down
17 changes: 15 additions & 2 deletions tests/mocha_adapter_tests.js
Expand Up @@ -402,8 +402,21 @@ describe('mochaAdapter', function() {
expect(originalEmit).to.have.been.calledWith(evt, test, err);
});

it('should not emit a "test-result" event', function() {
expect(_emit).not.to.have.been.called();
it('should emit a "test-result" event', function() {
expect(_emit).to.have.been.calledWith('test-result', {
failed: 1,
id: 1,
items: [{
passed: false,
message: 'The error message',
stack: 'The stack trace'
}],
name: 'foo ',
passed: 0,
pending: 0,
runDuration: 123,
total: 1
});
});
});
});
Expand Down

0 comments on commit 3eba6a5

Please sign in to comment.