Skip to content

Commit

Permalink
Print the planned and actual assertion count when incorrect.
Browse files Browse the repository at this point in the history
Fixes avajs#102
  • Loading branch information
jamestalmage committed Mar 22, 2016
1 parent ad02c32 commit c09cc49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Test.prototype._checkPlanCount = function () {
this._setAssertError(new assert.AssertionError({
actual: this.assertions.length,
expected: this.planCount,
message: 'Assertion count does not match planned',
message: 'Planned for ' + this.planCount + ' assertions, but got ' + this.assertions.length + '.',
operator: 'plan'
}));

Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test('run more assertions than planned', function (t) {
t.is(result.reason.name, 'AssertionError');
t.is(result.reason.expected, 2);
t.is(result.reason.actual, 3);
t.match(result.reason.message, /count does not match planned/);
t.match(result.reason.message, /Planned for 2 assertions, but got 3\./);
t.end();
});

Expand Down

0 comments on commit c09cc49

Please sign in to comment.