From 330a4249a3b56bcb464833e9458c5a3c72b37590 Mon Sep 17 00:00:00 2001 From: Jim Argeropoulos Date: Fri, 10 Jul 2015 13:25:03 -0400 Subject: [PATCH 1/2] When with fails, report not only the expected, but the actual. --- lib/spy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spy.js b/lib/spy.js index 40e56c3..fe6aeb7 100644 --- a/lib/spy.js +++ b/lib/spy.js @@ -269,7 +269,7 @@ module.exports = function (chai, _) { this.assert( passed > 0 - , 'expected ' + this._obj + ' to have been called with #{exp}' + , 'expected ' + this._obj + ' to have been called with #{exp} but got [ ' + args.toString() + ' ]' , 'expected ' + this._his + ' to have not been called with #{exp} but got ' + passed + ' times' , args ); From a7c36d18f124cd9891d734318d3127716245d157 Mon Sep 17 00:00:00 2001 From: Jim Argeropoulos Date: Mon, 13 Jul 2015 08:43:55 -0400 Subject: [PATCH 2/2] Used the lib standard way to put actuals into the message. --- lib/spy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spy.js b/lib/spy.js index fe6aeb7..6b5db55 100644 --- a/lib/spy.js +++ b/lib/spy.js @@ -269,7 +269,7 @@ module.exports = function (chai, _) { this.assert( passed > 0 - , 'expected ' + this._obj + ' to have been called with #{exp} but got [ ' + args.toString() + ' ]' + , 'expected ' + this._obj + ' to have been called with #{exp} but got #{act}' , 'expected ' + this._his + ' to have not been called with #{exp} but got ' + passed + ' times' , args );