From c371b56a23c4787604456a06290fa93318de0047 Mon Sep 17 00:00:00 2001 From: mirarifhasan Date: Tue, 21 May 2024 20:27:51 +0600 Subject: [PATCH] test: fix test cases --- packages/hoppscotch-backend/src/admin/admin.service.spec.ts | 4 +++- packages/hoppscotch-backend/src/auth/auth.service.spec.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-backend/src/admin/admin.service.spec.ts b/packages/hoppscotch-backend/src/admin/admin.service.spec.ts index a7ebc0682..9a9807e78 100644 --- a/packages/hoppscotch-backend/src/admin/admin.service.spec.ts +++ b/packages/hoppscotch-backend/src/admin/admin.service.spec.ts @@ -22,6 +22,7 @@ import { ShortcodeService } from 'src/shortcode/shortcode.service'; import { ConfigService } from '@nestjs/config'; import { OffsetPaginationArgs } from 'src/types/input-types.args'; import * as E from 'fp-ts/Either'; +import { EventEmitter2 } from '@nestjs/event-emitter'; const mockPrisma = mockDeep(); const mockPubSub = mockDeep(); @@ -34,6 +35,7 @@ const mockTeamCollectionService = mockDeep(); const mockMailerService = mockDeep(); const mockShortcodeService = mockDeep(); const mockConfigService = mockDeep(); +const mockEventEmitter = mockDeep(); const adminService = new AdminService( mockUserService, @@ -44,9 +46,9 @@ const adminService = new AdminService( mockTeamInvitationService, mockPubSub as any, mockPrisma as any, - mockMailerService, mockShortcodeService, mockConfigService, + mockEventEmitter, ); const invitedUsers: InvitedUsers[] = [ diff --git a/packages/hoppscotch-backend/src/auth/auth.service.spec.ts b/packages/hoppscotch-backend/src/auth/auth.service.spec.ts index c8979518b..d9c57ac83 100644 --- a/packages/hoppscotch-backend/src/auth/auth.service.spec.ts +++ b/packages/hoppscotch-backend/src/auth/auth.service.spec.ts @@ -23,6 +23,7 @@ import * as argon2 from 'argon2'; import * as E from 'fp-ts/Either'; import { ConfigService } from '@nestjs/config'; import { InfraConfigService } from 'src/infra-config/infra-config.service'; +import { EventEmitter2 } from '@nestjs/event-emitter'; const mockPrisma = mockDeep(); const mockUser = mockDeep(); @@ -30,6 +31,7 @@ const mockJWT = mockDeep(); const mockMailer = mockDeep(); const mockConfigService = mockDeep(); const mockInfraConfigService = mockDeep(); +const mockEventEmitter = mockDeep(); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -37,9 +39,9 @@ const authService = new AuthService( mockUser, mockPrisma, mockJWT, - mockMailer, mockConfigService, mockInfraConfigService, + mockEventEmitter, ); const currentTime = new Date();