@@ -307,6 +307,147 @@ expect(
307307 ) ,
308308) . type . toBeVoid ( ) ;
309309
310+ expect (
311+ jestExpect ( jest . fn < ( ) => void > ( ) ) . toHaveBeenCalledWith ( ) ,
312+ ) . type . toBeVoid ( ) ;
313+ expect (
314+ jestExpect ( jest . fn < ( ) => void > ( ) ) . toHaveBeenCalledWith ( 1 ) ,
315+ ) . type . toRaiseError ( ) ;
316+
317+ expect (
318+ jestExpect ( jest . fn < ( n ?: number ) => void > ( ) ) . toHaveBeenCalledWith ( ) ,
319+ ) . type . toBeVoid ( ) ;
320+ expect (
321+ jestExpect ( jest . fn < ( n ?: number ) => void > ( ) ) . toHaveBeenCalledWith ( 123 ) ,
322+ ) . type . toBeVoid ( ) ;
323+ expect (
324+ jestExpect ( jest . fn < ( n ?: number ) => void > ( ) ) . toHaveBeenCalledWith ( 'value' ) ,
325+ ) . type . toRaiseError ( ) ;
326+
327+ expect (
328+ jestExpect ( jest . fn < ( n : number ) => void > ( ) ) . toHaveBeenCalledWith ( 123 ) ,
329+ ) . type . toBeVoid ( ) ;
330+ expect (
331+ jestExpect ( jest . fn < ( n : number ) => void > ( ) ) . toHaveBeenCalledWith ( ) ,
332+ ) . type . toRaiseError ( ) ;
333+ expect (
334+ jestExpect ( jest . fn < ( n : number ) => void > ( ) ) . toHaveBeenCalledWith ( 'value' ) ,
335+ ) . type . toRaiseError ( ) ;
336+
337+ expect (
338+ jestExpect ( jest . fn < ( s : string ) => void > ( ) ) . toHaveBeenCalledWith ( 'value' ) ,
339+ ) . type . toBeVoid ( ) ;
340+ expect (
341+ jestExpect ( jest . fn < ( s : string ) => void > ( ) ) . toHaveBeenCalledWith ( ) ,
342+ ) . type . toRaiseError ( ) ;
343+ expect (
344+ jestExpect ( jest . fn < ( s : string ) => void > ( ) ) . toHaveBeenCalledWith ( 123 ) ,
345+ ) . type . toRaiseError ( ) ;
346+
347+ expect (
348+ jestExpect ( jest . fn < ( n : number , s : string ) => void > ( ) ) . toHaveBeenCalledWith (
349+ 123 ,
350+ 'value' ,
351+ ) ,
352+ ) . type . toBeVoid ( ) ;
353+ expect (
354+ jestExpect ( jest . fn < ( n : number , s : string ) => void > ( ) ) . toHaveBeenCalledWith ( ) ,
355+ ) . type . toRaiseError ( ) ;
356+ expect (
357+ jestExpect ( jest . fn < ( n : number , s : string ) => void > ( ) ) . toHaveBeenCalledWith (
358+ 123 ,
359+ ) ,
360+ ) . type . toRaiseError ( ) ;
361+ expect (
362+ jestExpect ( jest . fn < ( n : number , s : string ) => void > ( ) ) . toHaveBeenCalledWith (
363+ 123 ,
364+ 123 ,
365+ ) ,
366+ ) . type . toRaiseError ( ) ;
367+ expect (
368+ jestExpect ( jest . fn < ( n : number , s : string ) => void > ( ) ) . toHaveBeenCalledWith (
369+ 'value' ,
370+ 'value' ,
371+ ) ,
372+ ) . type . toRaiseError ( ) ;
373+ expect (
374+ jestExpect ( jest . fn < ( n : number , s : string ) => void > ( ) ) . toHaveBeenCalledWith (
375+ 'value' ,
376+ 123 ,
377+ ) ,
378+ ) . type . toRaiseError ( ) ;
379+
380+ expect (
381+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith (
382+ 123 ,
383+ 'value' ,
384+ ) ,
385+ ) . type . toBeVoid ( ) ;
386+ expect (
387+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith (
388+ 123 ,
389+ ) ,
390+ ) . type . toBeVoid ( ) ;
391+ expect (
392+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith ( ) ,
393+ ) . type . toRaiseError ( ) ;
394+ expect (
395+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith (
396+ 'value' ,
397+ ) ,
398+ ) . type . toRaiseError ( ) ;
399+ expect (
400+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith (
401+ 'value' ,
402+ 'value' ,
403+ ) ,
404+ ) . type . toRaiseError ( ) ;
405+ expect (
406+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith (
407+ 'value' ,
408+ 123 ,
409+ ) ,
410+ ) . type . toRaiseError ( ) ;
411+ expect (
412+ jestExpect ( jest . fn < ( n : number , s ?: string ) => void > ( ) ) . toHaveBeenCalledWith (
413+ 123 ,
414+ 123 ,
415+ ) ,
416+ ) . type . toRaiseError ( ) ;
417+
418+ // TODO test overloaded with union type?
419+ function overloaded ( ) : void ;
420+ // eslint-disable-next-line @typescript-eslint/unified-signatures
421+ function overloaded ( n : number ) : void ;
422+ // eslint-disable-next-line @typescript-eslint/unified-signatures
423+ function overloaded ( n : number , s : string ) : void ;
424+ function overloaded ( n ?: number , s ?: string ) : void {
425+ // noop
426+ }
427+
428+ expect (
429+ jestExpect ( jest . fn < typeof overloaded > ( ) ) . toHaveBeenCalledWith ( ) ,
430+ ) . type . toBeVoid ( ) ;
431+ expect (
432+ jestExpect ( jest . fn < typeof overloaded > ( ) ) . toHaveBeenCalledWith ( 123 ) ,
433+ ) . type . toBeVoid ( ) ;
434+ expect (
435+ jestExpect ( jest . fn < typeof overloaded > ( ) ) . toHaveBeenCalledWith ( 123 , 'value' ) ,
436+ ) . type . toBeVoid ( ) ;
437+ expect (
438+ jestExpect ( jest . fn < typeof overloaded > ( ) ) . toHaveBeenCalledWith ( 123 , 123 ) ,
439+ ) . type . toRaiseError ( ) ;
440+ expect (
441+ jestExpect ( jest . fn < typeof overloaded > ( ) ) . toHaveBeenCalledWith ( 'value' ) ,
442+ ) . type . toRaiseError ( ) ;
443+ expect (
444+ jestExpect ( jest . fn < typeof overloaded > ( ) ) . toHaveBeenCalledWith (
445+ 'value' ,
446+ 'value' ,
447+ ) ,
448+ ) . type . toRaiseError ( ) ;
449+
450+ // TODO add typed parameters tests
310451expect ( jestExpect ( jest . fn ( ) ) . toHaveBeenLastCalledWith ( ) ) . type . toBeVoid ( ) ;
311452expect ( jestExpect ( jest . fn ( ) ) . toHaveBeenLastCalledWith ( 'value' ) ) . type . toBeVoid ( ) ;
312453expect ( jestExpect ( jest . fn ( ) ) . toHaveBeenLastCalledWith ( 123 ) ) . type . toBeVoid ( ) ;
@@ -322,6 +463,7 @@ expect(
322463 ) . toHaveBeenLastCalledWith ( jestExpect . stringContaining ( 'value' ) , 123 ) ,
323464) . type . toBeVoid ( ) ;
324465
466+ // TODO add typed parameters tests
325467expect ( jestExpect ( jest . fn ( ) ) . toHaveBeenNthCalledWith ( 2 ) ) . type . toBeVoid ( ) ;
326468expect (
327469 jestExpect ( jest . fn ( ) ) . toHaveBeenNthCalledWith ( 1 , 'value' ) ,
0 commit comments