import { createMock } from 'ts-auto-mock' ; describe ( 'for call signature' , ( ) => { interface InterfaceWithCallSignatureReturn { ( a ) : InterfaceWithCallSignatureReturn ; b : string ; } it ( 'should register that the spy was called' , ( ) => { const properties = createMock < InterfaceWithCallSignatureReturn > ( ) ; properties ( 0 ) ; expect ( properties ) . toHaveBeenCalledTimes ( 1 ) ; } ) ; it ( 'should register that different spies was called ' , ( ) => { const properties = createMock < InterfaceWithCallSignatureReturn > ( ) ; const firstCall = properties ( 0 ) ; const secondCall = firstCall ( 0 ) ; secondCall ( 0 ) ; expect ( properties ) . toHaveBeenCalledTimes ( 1 ) ; expect ( firstCall ) . toHaveBeenCalledTimes ( 1 ) ; expect ( secondCall ) . toHaveBeenCalledTimes ( 1 ) ; expect ( secondCall ) . toHaveBeenCalledWith ( 0 ) ; } ) ; } ) ;