@@ -186,6 +186,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
186186 'expected #{this} to be truthy' ,
187187 'expected #{this} to not be truthy' ,
188188 obj ,
189+ false ,
189190 )
190191 } )
191192 def ( 'toBeFalsy' , function ( ) {
@@ -195,6 +196,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
195196 'expected #{this} to be falsy' ,
196197 'expected #{this} to not be falsy' ,
197198 obj ,
199+ false ,
198200 )
199201 } )
200202 def ( 'toBeGreaterThan' , function ( expected : number | bigint ) {
@@ -207,6 +209,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
207209 `expected ${ actual } to be not greater than ${ expected } ` ,
208210 actual ,
209211 expected ,
212+ false ,
210213 )
211214 } )
212215 def ( 'toBeGreaterThanOrEqual' , function ( expected : number | bigint ) {
@@ -219,6 +222,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
219222 `expected ${ actual } to be not greater than or equal to ${ expected } ` ,
220223 actual ,
221224 expected ,
225+ false ,
222226 )
223227 } )
224228 def ( 'toBeLessThan' , function ( expected : number | bigint ) {
@@ -231,6 +235,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
231235 `expected ${ actual } to be not less than ${ expected } ` ,
232236 actual ,
233237 expected ,
238+ false ,
234239 )
235240 } )
236241 def ( 'toBeLessThanOrEqual' , function ( expected : number | bigint ) {
@@ -243,6 +248,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
243248 `expected ${ actual } to be not less than or equal to ${ expected } ` ,
244249 actual ,
245250 expected ,
251+ false ,
246252 )
247253 } )
248254 def ( 'toBeNaN' , function ( ) {
@@ -328,6 +334,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
328334 `expected #{this} to not be close to #{exp}, received difference is ${ receivedDiff } , but expected ${ expectedDiff } ` ,
329335 received ,
330336 expected ,
337+ false ,
331338 )
332339 } )
333340
@@ -356,10 +363,10 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
356363 }
357364 const formatCalls = ( spy : EnhancedSpy , msg : string , actualCall ?: any ) => {
358365 if ( spy . mock . calls ) {
359- msg += c ( ) . gray ( `\n\nReceived: \n${ spy . mock . calls . map ( ( callArg , i ) => {
360- let methodCall = c ( ) . bold ( ` ${ ordinalOf ( i + 1 ) } ${ spy . getMockName ( ) } call:\n\n` )
366+ msg += c ( ) . gray ( `\n\nReceived: \n\n ${ spy . mock . calls . map ( ( callArg , i ) => {
367+ let methodCall = c ( ) . bold ( ` ${ ordinalOf ( i + 1 ) } ${ spy . getMockName ( ) } call:\n\n` )
361368 if ( actualCall )
362- methodCall += diff ( actualCall , callArg , { showLegend : false } )
369+ methodCall += diff ( actualCall , callArg , { omitAnnotationLines : true } )
363370 else
364371 methodCall += stringify ( callArg ) . split ( '\n' ) . map ( line => ` ${ line } ` ) . join ( '\n' )
365372
@@ -371,10 +378,10 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
371378 return msg
372379 }
373380 const formatReturns = ( spy : EnhancedSpy , msg : string , actualReturn ?: any ) => {
374- msg += c ( ) . gray ( `\n\nReceived: \n${ spy . mock . results . map ( ( callReturn , i ) => {
375- let methodCall = c ( ) . bold ( ` ${ ordinalOf ( i + 1 ) } ${ spy . getMockName ( ) } call return:\n\n` )
381+ msg += c ( ) . gray ( `\n\nReceived: \n\n ${ spy . mock . results . map ( ( callReturn , i ) => {
382+ let methodCall = c ( ) . bold ( ` ${ ordinalOf ( i + 1 ) } ${ spy . getMockName ( ) } call return:\n\n` )
376383 if ( actualReturn )
377- methodCall += diff ( actualReturn , callReturn . value , { showLegend : false } )
384+ methodCall += diff ( actualReturn , callReturn . value , { omitAnnotationLines : true } )
378385 else
379386 methodCall += stringify ( callReturn ) . split ( '\n' ) . map ( line => ` ${ line } ` ) . join ( '\n' )
380387
@@ -394,6 +401,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
394401 `expected "${ spyName } " to not be called #{exp} times` ,
395402 number ,
396403 callCount ,
404+ false ,
397405 )
398406 } )
399407 def ( 'toHaveBeenCalledOnce' , function ( ) {
@@ -406,6 +414,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
406414 `expected "${ spyName } " to not be called once` ,
407415 1 ,
408416 callCount ,
417+ false ,
409418 )
410419 } )
411420 def ( [ 'toHaveBeenCalled' , 'toBeCalled' ] , function ( ) {
@@ -525,6 +534,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
525534 `expected error not to be instance of ${ name } ` ,
526535 expected ,
527536 thrown ,
537+ false ,
528538 )
529539 }
530540
@@ -546,6 +556,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
546556 'expected error not to match asymmetric matcher' ,
547557 matcher . toString ( ) ,
548558 thrown ,
559+ false ,
549560 )
550561 }
551562
@@ -561,6 +572,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
561572 `expected "${ spyName } " to not be successfully called` ,
562573 calledAndNotThrew ,
563574 ! calledAndNotThrew ,
575+ false ,
564576 )
565577 } )
566578 def ( [ 'toHaveReturnedTimes' , 'toReturnTimes' ] , function ( times : number ) {
@@ -573,6 +585,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
573585 `expected "${ spyName } " to not be successfully called ${ times } times` ,
574586 `expected number of returns: ${ times } ` ,
575587 `received number of returns: ${ successfulReturns } ` ,
588+ false ,
576589 )
577590 } )
578591 def ( [ 'toHaveReturnedWith' , 'toReturnWith' ] , function ( value : any ) {
0 commit comments