diff --git a/src/health/health.controller.spec.ts b/src/health/health.controller.spec.ts index 7de55d4..7d1cf84 100644 --- a/src/health/health.controller.spec.ts +++ b/src/health/health.controller.spec.ts @@ -1,3 +1,4 @@ +import { InjectionToken } from '@nestjs/common'; import { HealthCheckResult, HealthCheckService, @@ -42,10 +43,14 @@ describe('HealthController', () => { } if (token === HealthCheckService) { - return new HealthCheckService(new HealthCheckExecutor(), null, null); + return new HealthCheckService( + new HealthCheckExecutor(), + { getErrorMessage: jest.fn() }, + { log: jest.fn(), error: jest.fn(), warn: jest.fn() }, + ); } - return useDefaultMockerToken(token); + return useDefaultMockerToken(token as InjectionToken); }) .compile(); diff --git a/src/health/indicators/jeyllfin.indicator.spec.ts b/src/health/indicators/jeyllfin.indicator.spec.ts index 38b12c7..dcebe2d 100644 --- a/src/health/indicators/jeyllfin.indicator.spec.ts +++ b/src/health/indicators/jeyllfin.indicator.spec.ts @@ -1,3 +1,4 @@ +import { InjectionToken } from '@nestjs/common'; import { HealthIndicatorResult } from '@nestjs/terminus'; import { Test } from '@nestjs/testing'; import { JellyfinService } from '../../clients/jellyfin/jellyfin.service'; @@ -16,7 +17,7 @@ describe('JellyfinHealthIndicator', () => { if (token === JellyfinService) { return { isConnected: jest.fn() }; } - return useDefaultMockerToken(token); + return useDefaultMockerToken(token as InjectionToken); }) .compile(); diff --git a/src/updates/updates.service.spec.ts b/src/updates/updates.service.spec.ts index 74f25ab..a72d899 100644 --- a/src/updates/updates.service.spec.ts +++ b/src/updates/updates.service.spec.ts @@ -6,6 +6,7 @@ import { DiscordMessageService } from '../clients/discord/discord.message.servic import { GithubRelease } from '../models/github-release'; import { useDefaultMockerToken } from '../utils/tests/defaultMockerToken'; import { UpdatesService } from './updates.service'; +import { InjectionToken } from '@nestjs/common'; // mock axios: https://stackoverflow.com/questions/51275434/type-of-axios-mock-using-jest-typescript/55351900#55351900 jest.mock('axios'); @@ -49,7 +50,7 @@ describe('UpdatesService', () => { }; } - return useDefaultMockerToken(token); + return useDefaultMockerToken(token as InjectionToken); }) .compile();