You need to provide some classes and decorators yourself to maintain the same style as [email protected]
.
@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}
↓
@CustomRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}
@Module({
exports: [UserService],
imports: [TypeOrmModule.forFeature([UserRepository])],
providers: [UserService],
})
export class UserModule {}
↓
@Module({
exports: [UserService],
imports: [TypeOrmExModule.forCustomRepository([UserRepository])],
providers: [UserService],
})
export class UserModule {}
@anchan828 Hi, this helped me a lot thank you, but how can mock this in tests? it's not a provider and the way I usually do was getRepositoryToken(Model) and it doesn't work.