export class RepositoryMock < T > { public one : T ; public list : T [ ] ; public findMock = jest . fn ( ) ; public findOneMock = jest . fn ( ) ; public saveMock = jest . fn ( ) ; public deleteMock = jest . fn ( ) ; public find ( ... args ) { this . findMock ( args ) ; return Promise . resolve ( this . list ) ; } public findOne ( ... args ) { this . findOneMock ( args ) ; return Promise . resolve ( this . one ) ; } public save ( value , ... args ) { this . saveMock ( value , args ) ; return Promise . resolve ( value ) ; } public delete ( value , ... args ) { this . deleteMock ( value , args ) ; return Promise . resolve ( value ) ; } }