diff --git a/src/services/mentor.service.test.ts b/src/services/mentor.service.test.ts index f6ab88e1..c8b39a04 100644 --- a/src/services/mentor.service.test.ts +++ b/src/services/mentor.service.test.ts @@ -1,12 +1,17 @@ import { getAllMentors } from './mentor.service' import { dataSource } from '../configs/dbConfig' -type MockMentorRepository = { +interface Mentor { + id: number + name: string +} + +interface MockMentorRepository { createQueryBuilder: jest.Mock leftJoinAndSelect: jest.Mock where: jest.Mock andWhere: jest.Mock - getMany: jest.Mock> + getMany: jest.Mock> } jest.mock('../configs/dbConfig', () => ({ @@ -61,7 +66,7 @@ describe('getAllMentors', () => { }) function createMockMentorRepository( - data: any[] | undefined, + data: Mentor[] | undefined, error?: Error ): MockMentorRepository { return {