34 lines
994 B
TypeScript
34 lines
994 B
TypeScript
import { DynamicModule, Global, Module } from "@nestjs/common";
|
|
import { IOrganization } from "../src";
|
|
import { IRepository } from "@apihub24/repository";
|
|
|
|
@Global()
|
|
@Module({})
|
|
export class OrganizationRepositoryMockModule {
|
|
static forRoot(): DynamicModule {
|
|
const providers = [
|
|
{
|
|
provide: "@apihub24/organization_repository",
|
|
useClass: OrganizationRepositoryMock,
|
|
},
|
|
];
|
|
return {
|
|
module: OrganizationRepositoryMockModule,
|
|
providers: [...providers],
|
|
exports: [...providers],
|
|
};
|
|
}
|
|
}
|
|
|
|
class OrganizationRepositoryMock implements IRepository<IOrganization> {
|
|
getBy(filter: (model: IOrganization) => boolean): Promise<IOrganization[]> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
save(models: IOrganization[]): Promise<IOrganization[]> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
deleteBy(filter: (model: IOrganization) => boolean): Promise<boolean> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
}
|