@@ -283,8 +283,10 @@ module.exports = function (chai, _) {
283
283
284
284
this . assert (
285
285
passed === calls . length
286
- , 'expected ' + this . _obj + ' to have been always called with #{exp} but got ' + passed + ' out of ' + calls . length
287
- , 'expected ' + this . _his + ' to have not always been called with #{exp}'
286
+ , 'expected ' + this . _obj + ' to have been always called with ' + _ . inspect ( args , false , 2 )
287
+ + ', but it was actually called ' + passed + ' times with those arguments out of ' + calls . length + ' total calls'
288
+ , 'expected ' + this . _his + ' to have not always been called with ' + _ . inspect ( args , false , 2 )
289
+ + ', but it was actually called ' + passed + ' times with those arguments out of ' + calls . length + ' total calls'
288
290
, args
289
291
) ;
290
292
} else {
@@ -301,8 +303,15 @@ module.exports = function (chai, _) {
301
303
302
304
this . assert (
303
305
passed > 0
304
- , 'expected ' + this . _obj + ' to have been called with #{exp}'
305
- , 'expected ' + this . _his + ' to have not been called with #{exp} but got ' + passed + ' times'
306
+ , 'expected ' + this . _obj + ' to have been called with ' + _ . inspect ( args , false , 2 ) + ' at least once'
307
+ + ( calls . length
308
+ ? ', but it was actually called ' + calls . length + ' times with:' + calls . map ( function ( call , i ) {
309
+ return '\ncall #' + ( i + 1 ) + ': ' + _ . inspect ( call , false , 2 ) ;
310
+ } ) . join ( '' )
311
+ : ', but it was actually not called'
312
+ )
313
+ , 'expected ' + this . _his + ' to have not been called with ' + _ . inspect ( args , false , 2 )
314
+ + ', but it actually was called ' + passed + ' times with those arguments, out of ' + calls . length + ' total calls'
306
315
, args
307
316
) ;
308
317
}
0 commit comments