mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-25 02:51:57 +01:00
✅ Fix faulty test
This commit is contained in:
parent
aee78672cc
commit
956b8f1338
@ -1,6 +1,7 @@
|
|||||||
import { Test } from '@nestjs/testing';
|
import { Test } from '@nestjs/testing';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Client, GuildMember } from 'discord.js';
|
import { Client, GuildMember } from 'discord.js';
|
||||||
|
import { Constants } from '../utils/constants';
|
||||||
import { DiscordMessageService } from '../clients/discord/discord.message.service';
|
import { DiscordMessageService } from '../clients/discord/discord.message.service';
|
||||||
import { GithubRelease } from '../models/github-release';
|
import { GithubRelease } from '../models/github-release';
|
||||||
import { useDefaultMockerToken } from '../utils/tests/defaultMockerToken';
|
import { useDefaultMockerToken } from '../utils/tests/defaultMockerToken';
|
||||||
@ -14,7 +15,6 @@ describe('UpdatesService', () => {
|
|||||||
const OLD_ENV = process.env;
|
const OLD_ENV = process.env;
|
||||||
|
|
||||||
let updatesService: UpdatesService;
|
let updatesService: UpdatesService;
|
||||||
let discordClient: Client;
|
|
||||||
let discordMessageService: DiscordMessageService;
|
let discordMessageService: DiscordMessageService;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@ -54,7 +54,6 @@ describe('UpdatesService', () => {
|
|||||||
.compile();
|
.compile();
|
||||||
|
|
||||||
updatesService = moduleRef.get<UpdatesService>(UpdatesService);
|
updatesService = moduleRef.get<UpdatesService>(UpdatesService);
|
||||||
discordClient = moduleRef.get<Client>('__inject_discord_client__');
|
|
||||||
discordMessageService = moduleRef.get<DiscordMessageService>(
|
discordMessageService = moduleRef.get<DiscordMessageService>(
|
||||||
DiscordMessageService,
|
DiscordMessageService,
|
||||||
);
|
);
|
||||||
@ -88,6 +87,12 @@ describe('UpdatesService', () => {
|
|||||||
|
|
||||||
it('handleCronShouldNotifyWhenNewRelease', async () => {
|
it('handleCronShouldNotifyWhenNewRelease', async () => {
|
||||||
process.env.UPDATER_DISABLE_NOTIFICATIONS = 'false';
|
process.env.UPDATER_DISABLE_NOTIFICATIONS = 'false';
|
||||||
|
Constants.Metadata.Version = {
|
||||||
|
All: () => '0.0.5',
|
||||||
|
Major: 0,
|
||||||
|
Minor: 0,
|
||||||
|
Patch: 5,
|
||||||
|
};
|
||||||
|
|
||||||
mockedAxios.mockResolvedValue({
|
mockedAxios.mockResolvedValue({
|
||||||
data: {
|
data: {
|
||||||
|
Loading…
Reference in New Issue
Block a user