🚨 Fix build errors

This commit is contained in:
Manuel 2023-04-02 16:54:24 +02:00
parent 49312412fb
commit 606c10ec6d
3 changed files with 11 additions and 4 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();