diff --git a/lib/test.js b/lib/test.js index 7fb034a95..d632e434b 100644 --- a/lib/test.js +++ b/lib/test.js @@ -7,6 +7,7 @@ var co = require('co-with-promise'); var observableToPromise = require('observable-to-promise'); var isPromise = require('is-promise'); var isObservable = require('is-observable'); +var plur = require('plur'); var inspect = require('util').inspect; var assert = require('./assert'); var enhanceAssert = require('./enhance-assert'); @@ -223,7 +224,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 + plur(' assertion', this.planCount) + ', but got ' + this.assertions.length + '.', operator: 'plan' })); diff --git a/test/test.js b/test/test.js index fa2922371..68db6dbe1 100644 --- a/test/test.js +++ b/test/test.js @@ -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(); });