I am trying to add more testing codes to improve the quality of my sample codes.
Currently, I have a problem when testing UserRepository (not mock UserRepository), there are some custom methods I added in my custom UserRepository like this.
@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {
findByEmail(email: string): Promise<UserEntity> {
return this.findOne({ email: email });
}
}
Run Code Online (Sandbox Code Playgroud)
So I want to verify the findOne is called from the parent Repository.
I tried to add the following …