My nestjs project uses typeorm custom repositories.
@EntityRepository(MyEntity)
export class MyRepository extends AbstractRepository<MyEntity> {
public operation1(entity) {
/**
* Few lines here
*/
this.manager.save(entity);
}
}
I am trying to write unit testcases using jest for the method operation1, But I am not able to mock this.manager.. Is there a way to mock this.manager. methods?