diff --git a/.idea/il-est-midi.iml b/.idea/il-est-midi.iml
index d723fde1d..fe218caf4 100644
--- a/.idea/il-est-midi.iml
+++ b/.idea/il-est-midi.iml
@@ -28,7 +28,6 @@
-
@@ -42,5 +41,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/classes/stores/abstract-entity-store.service.spec.ts b/src/classes/stores/abstract-entity-store.service.spec.ts
index 86b2561a7..64c7018ea 100644
--- a/src/classes/stores/abstract-entity-store.service.spec.ts
+++ b/src/classes/stores/abstract-entity-store.service.spec.ts
@@ -1,7 +1,7 @@
import { AbstractEntityStoreService } from './abstract-entity-store.service';
import { ServiceNameEnum } from '../../enums/service-name.enum';
import { CoreEventService } from '../../features/core/services/core-event.service';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
interface IDummy {
name: string;
@@ -9,7 +9,7 @@ interface IDummy {
class DummyService extends AbstractEntityStoreService {
public constructor(serviceName: ServiceNameEnum) {
- super(serviceName, createMock());
+ super(serviceName, createHydratedMock());
}
}
diff --git a/src/classes/stores/abstract-store.service.spec.ts b/src/classes/stores/abstract-store.service.spec.ts
index e9dae0f64..face90203 100644
--- a/src/classes/stores/abstract-store.service.spec.ts
+++ b/src/classes/stores/abstract-store.service.spec.ts
@@ -1,7 +1,7 @@
import { AbstractStoreService } from './abstract-store.service';
import { ServiceNameEnum } from '../../enums/service-name.enum';
import { CoreEventService } from '../../features/core/services/core-event.service';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
interface IDummy {
name: string;
@@ -9,7 +9,7 @@ interface IDummy {
class DummyService extends AbstractStoreService {
public constructor(serviceName: ServiceNameEnum) {
- super(serviceName, createMock());
+ super(serviceName, createHydratedMock());
}
}
diff --git a/src/features/discord/activities/services/discord-activity-sonia.service.spec.ts b/src/features/discord/activities/services/discord-activity-sonia.service.spec.ts
index 2515ff117..2587f577a 100644
--- a/src/features/discord/activities/services/discord-activity-sonia.service.spec.ts
+++ b/src/features/discord/activities/services/discord-activity-sonia.service.spec.ts
@@ -15,7 +15,7 @@ import { Activity, Client, Presence, PresenceData } from 'discord.js';
import _ from 'lodash';
import * as NodeScheduleModule from 'node-schedule';
import { BehaviorSubject, noop } from 'rxjs';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
jest.mock(`node-schedule`);
@@ -82,7 +82,7 @@ describe(`DiscordActivitySoniaService`, (): void => {
beforeEach((): void => {
service = new DiscordActivitySoniaService();
- presence = createMock();
+ presence = createHydratedMock();
loggerServiceDebugSpy = jest.spyOn(loggerService, `debug`).mockImplementation();
discordClientServiceGetClientSpy = jest.spyOn(discordClientService, `isReady$`).mockReturnValue(isReady$);
@@ -206,7 +206,7 @@ describe(`DiscordActivitySoniaService`, (): void => {
.mockReturnValueOnce(`dummy-schedule`)
.mockReturnValueOnce(`dummy-new-schedule`);
service = new DiscordActivitySoniaService();
- job = createMock({
+ job = createHydratedMock({
reschedule: jobRescheduleMock,
});
@@ -567,7 +567,7 @@ describe(`DiscordActivitySoniaService`, (): void => {
beforeEach((): void => {
service = new DiscordActivitySoniaService();
- presence = createMock({
+ presence = createHydratedMock({
activities: [
{
name: DiscordActivityNameEnum.APOLLO,
@@ -577,12 +577,12 @@ describe(`DiscordActivitySoniaService`, (): void => {
],
});
setPresenceMock = jest.fn, unknown[]>().mockRejectedValue(new Error(`setPresence: error`));
- presenceActivity = createMock({
+ presenceActivity = createHydratedMock({
name: DiscordActivityNameEnum.APOLLO,
type: `PLAYING`,
url: `dummy-url`,
});
- client = createMock({
+ client = createHydratedMock({
user: {
setPresence: setPresenceMock,
},
diff --git a/src/features/discord/authentications/services/discord-authentication.service.spec.ts b/src/features/discord/authentications/services/discord-authentication.service.spec.ts
index 7f6c266ff..a9f2379c0 100644
--- a/src/features/discord/authentications/services/discord-authentication.service.spec.ts
+++ b/src/features/discord/authentications/services/discord-authentication.service.spec.ts
@@ -7,7 +7,7 @@ import { DiscordClientService } from '../../services/discord-client.service';
import { DiscordSoniaConfigService } from '../../users/services/config/discord-sonia-config.service';
import { Client } from 'discord.js';
import { take } from 'rxjs/operators';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -77,7 +77,7 @@ describe(`DiscordAuthenticationService`, (): void => {
beforeEach((): void => {
service = new DiscordAuthenticationService();
discordClientServiceGetClientOnMock = jest.fn();
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -111,7 +111,7 @@ describe(`DiscordAuthenticationService`, (): void => {
discordClientServiceGetClientOnMock = jest.fn((_event: string, listener: () => void): void => {
listener();
});
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -129,7 +129,7 @@ describe(`DiscordAuthenticationService`, (): void => {
describe(`when the Discord client user is null`, (): void => {
beforeEach((): void => {
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
user: null,
});
@@ -155,7 +155,7 @@ describe(`DiscordAuthenticationService`, (): void => {
beforeEach((): void => {
tag = `dummy-tag`;
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
user: {
tag,
@@ -223,7 +223,7 @@ describe(`DiscordAuthenticationService`, (): void => {
beforeEach((): void => {
loginMock = jest.fn().mockResolvedValue(`login`);
- client = createMock({
+ client = createHydratedMock({
login: loginMock,
});
@@ -278,7 +278,7 @@ describe(`DiscordAuthenticationService`, (): void => {
describe(`when the login failed`, (): void => {
beforeEach((): void => {
loginMock = jest.fn().mockRejectedValue(new Error(`error`));
- client = createMock({
+ client = createHydratedMock({
login: loginMock,
});
@@ -329,7 +329,7 @@ describe(`DiscordAuthenticationService`, (): void => {
describe(`when the login was successful`, (): void => {
beforeEach((): void => {
loginMock.mockResolvedValue(``);
- client = createMock({
+ client = createHydratedMock({
login: loginMock,
});
diff --git a/src/features/discord/channels/functions/types/is-discord-guild-channel-writable.spec.ts b/src/features/discord/channels/functions/types/is-discord-guild-channel-writable.spec.ts
index a1aa303ec..0a68ac9e0 100644
--- a/src/features/discord/channels/functions/types/is-discord-guild-channel-writable.spec.ts
+++ b/src/features/discord/channels/functions/types/is-discord-guild-channel-writable.spec.ts
@@ -1,14 +1,14 @@
import { isDiscordGuildChannelWritable } from './is-discord-guild-channel-writable';
import { CategoryChannel, GuildChannel, NewsChannel, StoreChannel, TextChannel, VoiceChannel } from 'discord.js';
import _ from 'lodash';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
describe(`isDiscordGuildChannelWritable()`, (): void => {
let guildChannel: GuildChannel;
describe(`when the given guild channel is a text channel`, (): void => {
beforeEach((): void => {
- guildChannel = createMock({
+ guildChannel = createHydratedMock({
isText(): boolean {
return _.includes([`text`, `news`], guildChannel.type);
},
@@ -26,7 +26,7 @@ describe(`isDiscordGuildChannelWritable()`, (): void => {
describe(`when the given guild channel is a voice channel`, (): void => {
beforeEach((): void => {
- guildChannel = createMock({
+ guildChannel = createHydratedMock({
isText(): boolean {
return _.includes([`text`, `news`], guildChannel.type);
},
@@ -44,7 +44,7 @@ describe(`isDiscordGuildChannelWritable()`, (): void => {
describe(`when the given guild channel is a category channel`, (): void => {
beforeEach((): void => {
- guildChannel = createMock({
+ guildChannel = createHydratedMock({
isText(): boolean {
return _.includes([`text`, `news`], guildChannel.type);
},
@@ -62,7 +62,7 @@ describe(`isDiscordGuildChannelWritable()`, (): void => {
describe(`when the given guild channel is a news channel`, (): void => {
beforeEach((): void => {
- guildChannel = createMock({
+ guildChannel = createHydratedMock({
isText(): boolean {
return _.includes([`text`, `news`], guildChannel.type);
},
@@ -80,7 +80,7 @@ describe(`isDiscordGuildChannelWritable()`, (): void => {
describe(`when the given guild channel is a store channel`, (): void => {
beforeEach((): void => {
- guildChannel = createMock({
+ guildChannel = createHydratedMock({
isText(): boolean {
return _.includes([`text`, `news`], guildChannel.type);
},
diff --git a/src/features/discord/channels/services/discord-channel-typing.service.spec.ts b/src/features/discord/channels/services/discord-channel-typing.service.spec.ts
index 5d80e9a83..d0e87e694 100644
--- a/src/features/discord/channels/services/discord-channel-typing.service.spec.ts
+++ b/src/features/discord/channels/services/discord-channel-typing.service.spec.ts
@@ -4,7 +4,7 @@ import { CoreEventService } from '../../../core/services/core-event.service';
import { ILoggerLog } from '../../../logger/interfaces/logger-log';
import { LoggerService } from '../../../logger/services/logger.service';
import { DMChannel, NewsChannel, TextChannel } from 'discord.js';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -67,7 +67,7 @@ describe(`DiscordChannelTypingService`, (): void => {
service = new DiscordChannelTypingService();
startTypingMock = jest.fn().mockRejectedValue(new Error(`startTyping error`));
- channel = createMock({
+ channel = createHydratedMock({
startTyping: startTypingMock,
});
loggerServiceErrorSpy = jest.spyOn(loggerService, `error`).mockImplementation();
@@ -85,7 +85,7 @@ describe(`DiscordChannelTypingService`, (): void => {
describe(`when an error occur with Discord`, (): void => {
beforeEach((): void => {
startTypingMock.mockRejectedValue(new Error(`startTyping error`));
- channel = createMock({
+ channel = createHydratedMock({
id: `dummy-channel-id`,
startTyping: startTypingMock,
});
@@ -111,7 +111,7 @@ describe(`DiscordChannelTypingService`, (): void => {
describe(`when the typing indicator was successfully shown into Discord`, (): void => {
beforeEach((): void => {
startTypingMock.mockResolvedValue(undefined);
- channel = createMock({
+ channel = createHydratedMock({
id: `dummy-channel-id`,
startTyping: startTypingMock,
});
@@ -136,7 +136,7 @@ describe(`DiscordChannelTypingService`, (): void => {
service = new DiscordChannelTypingService();
stopTypingMock = jest.fn().mockImplementation();
- channel = createMock({
+ channel = createHydratedMock({
stopTyping: stopTypingMock,
});
});
diff --git a/src/features/discord/emotional-states/services/discord-sonia-emotional-state.service.spec.ts b/src/features/discord/emotional-states/services/discord-sonia-emotional-state.service.spec.ts
index 2d7f3632e..d70cfe5e5 100644
--- a/src/features/discord/emotional-states/services/discord-sonia-emotional-state.service.spec.ts
+++ b/src/features/discord/emotional-states/services/discord-sonia-emotional-state.service.spec.ts
@@ -12,7 +12,7 @@ import { DISCORD_EMOTIONAL_STATE_MESSAGES } from '../constants/discord-emotional
import { DiscordSoniaEmotionalStateEnum } from '../enums/discord-sonia-emotional-state.enum';
import * as NodeScheduleModule from 'node-schedule';
import { BehaviorSubject, noop } from 'rxjs';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
jest.mock(`node-schedule`);
@@ -203,7 +203,7 @@ describe(`DiscordSoniaEmotionalStateService`, (): void => {
.mockReturnValueOnce(`dummy-schedule`)
.mockReturnValueOnce(`dummy-new-schedule`);
service = new DiscordSoniaEmotionalStateService();
- job = createMock({
+ job = createHydratedMock({
reschedule: jobRescheduleMock,
});
diff --git a/src/features/discord/guilds/services/__mocks__/discord-guild-sonia.service.ts b/src/features/discord/guilds/services/__mocks__/discord-guild-sonia.service.ts
index 0afbcdf22..6f5d2154d 100644
--- a/src/features/discord/guilds/services/__mocks__/discord-guild-sonia.service.ts
+++ b/src/features/discord/guilds/services/__mocks__/discord-guild-sonia.service.ts
@@ -2,7 +2,7 @@ import { AbstractService } from '../../../../../classes/services/abstract.servic
import { ServiceNameEnum } from '../../../../../enums/service-name.enum';
import { GuildChannel } from 'discord.js';
import _ from 'lodash';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
export class DiscordGuildSoniaService extends AbstractService {
private static _instance: DiscordGuildSoniaService;
@@ -26,7 +26,7 @@ export class DiscordGuildSoniaService extends AbstractService {
public sendMessageToChannel(): void {}
public getSoniaGuildChannelByName(): GuildChannel | null | undefined {
- return createMock();
+ return createHydratedMock();
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
diff --git a/src/features/discord/guilds/services/discord-guild-create.service.spec.ts b/src/features/discord/guilds/services/discord-guild-create.service.spec.ts
index 99b803649..52d3c6923 100644
--- a/src/features/discord/guilds/services/discord-guild-create.service.spec.ts
+++ b/src/features/discord/guilds/services/discord-guild-create.service.spec.ts
@@ -17,7 +17,7 @@ import { IDiscordGuildSoniaSendMessageToChannel } from '../interfaces/discord-gu
import { Client, Guild, GuildChannel, Message, TextChannel } from 'discord.js';
import * as admin from 'firebase-admin';
import { of, throwError } from 'rxjs';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`./discord-guild-sonia.service`);
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -104,10 +104,10 @@ describe(`DiscordGuildCreateService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildCreateService();
discordClientServiceGetClientOnMock = jest.fn();
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
- guild = createMock({
+ guild = createHydratedMock({
id: `dummy-guild-id`,
});
@@ -144,7 +144,7 @@ describe(`DiscordGuildCreateService`, (): void => {
discordClientServiceGetClientOnMock = jest.fn((_event: string, listener: (guild: Guild) => void): void => {
listener(guild);
});
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -291,11 +291,11 @@ describe(`DiscordGuildCreateService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildCreateService();
- guild = createMock();
- primaryGuildChannel = createMock();
- discordMessageResponse = createMock();
- discordMessageErrorResponse = createMock();
- message = createMock();
+ guild = createHydratedMock();
+ primaryGuildChannel = createHydratedMock();
+ discordMessageResponse = createHydratedMock();
+ discordMessageErrorResponse = createHydratedMock();
+ message = createHydratedMock();
discordGuildConfigServiceShouldSendCookiesOnCreateSpy = jest
.spyOn(discordGuildConfigService, `shouldSendCookiesOnCreate`)
@@ -390,14 +390,14 @@ describe(`DiscordGuildCreateService`, (): void => {
describe(`when the primary guild channel was found`, (): void => {
beforeEach((): void => {
- primaryGuildChannel = createMock();
+ primaryGuildChannel = createHydratedMock();
discordChannelGuildServiceGetPrimarySpy.mockReturnValue(primaryGuildChannel);
});
describe(`when the primary guild channel is not writable`, (): void => {
beforeEach((): void => {
- primaryGuildChannel = createMock({
+ primaryGuildChannel = createHydratedMock({
type: `voice`,
});
@@ -427,7 +427,7 @@ describe(`DiscordGuildCreateService`, (): void => {
describe(`when the primary guild channel is writable`, (): void => {
beforeEach((): void => {
- primaryGuildChannel = createMock({
+ primaryGuildChannel = createHydratedMock({
isText(): true {
return true;
},
@@ -557,10 +557,10 @@ describe(`DiscordGuildCreateService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildCreateService();
- guild = createMock({
+ guild = createHydratedMock({
id: `dummy-id`,
});
- writeResult = createMock();
+ writeResult = createHydratedMock();
firebaseGuildsServiceIsReady$Spy = jest.spyOn(firebaseGuildsService, `isReady$`).mockReturnValue(of(true));
firebaseGuildsServiceHasGuildSpy = jest
diff --git a/src/features/discord/guilds/services/discord-guild-member-add.service.spec.ts b/src/features/discord/guilds/services/discord-guild-member-add.service.spec.ts
index 89ed313f8..020542e68 100644
--- a/src/features/discord/guilds/services/discord-guild-member-add.service.spec.ts
+++ b/src/features/discord/guilds/services/discord-guild-member-add.service.spec.ts
@@ -7,7 +7,7 @@ import { DiscordMessageRightsService } from '../../messages/services/rights/disc
import { DiscordClientService } from '../../services/discord-client.service';
import { IAnyGuildMember } from '../types/any-guild-member';
import { Client } from 'discord.js';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -75,7 +75,7 @@ describe(`DiscordGuildMemberAddService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildMemberAddService();
discordClientServiceGetClientOnMock = jest.fn();
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -107,7 +107,7 @@ describe(`DiscordGuildMemberAddService`, (): void => {
discordClientServiceGetClientOnMock = jest.fn((_event: string, listener: () => void): void => {
listener();
});
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -156,7 +156,7 @@ describe(`DiscordGuildMemberAddService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildMemberAddService();
- member = createMock({
+ member = createHydratedMock({
guild: {
id: `dummy-guild-id`,
},
diff --git a/src/features/discord/guilds/services/discord-guild.service.spec.ts b/src/features/discord/guilds/services/discord-guild.service.spec.ts
index 9e97cf3e4..d3683a692 100644
--- a/src/features/discord/guilds/services/discord-guild.service.spec.ts
+++ b/src/features/discord/guilds/services/discord-guild.service.spec.ts
@@ -5,7 +5,7 @@ import { ILoggerLog } from '../../../logger/interfaces/logger-log';
import { LoggerService } from '../../../logger/services/logger.service';
import { DiscordClientService } from '../../services/discord-client.service';
import { Client, Guild, Snowflake } from 'discord.js';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -111,12 +111,12 @@ describe(`DiscordGuildService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildService();
- guilds = [createMock(), createMock()];
+ guilds = [createHydratedMock(), createHydratedMock()];
arrayMock = jest.fn().mockReturnValue(guilds);
// @todo remove casting once https://github.com/Typescript-TDD/ts-auto-mock/issues/464 is fixed
discordClientServiceGetClientSpy = jest.spyOn(discordClientService, `getClient`).mockReturnValue(
- createMock({
+ createHydratedMock({
guilds: {
cache: ({
array: arrayMock,
@@ -155,7 +155,7 @@ describe(`DiscordGuildService`, (): void => {
beforeEach((): void => {
service = new DiscordGuildService();
- guild = createMock();
+ guild = createHydratedMock();
findMock = jest.fn().mockImplementation(
(fn: (value: Guild) => boolean): Guild => {
@@ -166,7 +166,7 @@ describe(`DiscordGuildService`, (): void => {
);
// @todo remove casting once https://github.com/Typescript-TDD/ts-auto-mock/issues/464 is fixed
discordClientServiceGetClientSpy = jest.spyOn(discordClientService, `getClient`).mockReturnValue(
- createMock({
+ createHydratedMock({
guilds: {
cache: ({
find: findMock,
diff --git a/src/features/discord/logger/services/__mocks__/discord-logger-error.service.ts b/src/features/discord/logger/services/__mocks__/discord-logger-error.service.ts
index 815f38c1d..ef23fa3bd 100644
--- a/src/features/discord/logger/services/__mocks__/discord-logger-error.service.ts
+++ b/src/features/discord/logger/services/__mocks__/discord-logger-error.service.ts
@@ -3,7 +3,7 @@ import { ServiceNameEnum } from '../../../../../enums/service-name.enum';
import { IDiscordMessageResponse } from '../../../messages/interfaces/discord-message-response';
import { MessageEmbed } from 'discord.js';
import _ from 'lodash';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
export class DiscordLoggerErrorService extends AbstractService {
private static _instance: DiscordLoggerErrorService;
@@ -26,7 +26,7 @@ export class DiscordLoggerErrorService extends AbstractService {
public getErrorMessageResponse(): IDiscordMessageResponse {
return {
options: {
- embed: createMock(),
+ embed: createHydratedMock(),
split: false,
},
response: ``,
diff --git a/src/features/discord/logger/services/discord-logger-error.service.spec.ts b/src/features/discord/logger/services/discord-logger-error.service.spec.ts
index 9d23328f7..ddc6f34f5 100644
--- a/src/features/discord/logger/services/discord-logger-error.service.spec.ts
+++ b/src/features/discord/logger/services/discord-logger-error.service.spec.ts
@@ -14,7 +14,7 @@ import cryptoRandomString from 'crypto-random-string';
import { MessageEmbedAuthor } from 'discord.js';
import _ from 'lodash';
import moment from 'moment-timezone';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -84,7 +84,7 @@ describe(`DiscordLoggerErrorService`, (): void => {
beforeEach((): void => {
service = new DiscordLoggerErrorService();
- discordMessageResponse = createMock();
+ discordMessageResponse = createHydratedMock();
loggerServiceErrorSpy = jest.spyOn(loggerService, `error`).mockImplementation();
loggerServiceDebugSpy = jest.spyOn(loggerService, `debug`).mockImplementation();
@@ -224,7 +224,7 @@ describe(`DiscordLoggerErrorService`, (): void => {
it(`should return an error message response with an embed author`, (): void => {
expect.assertions(1);
- const messageEmbedAuthor: MessageEmbedAuthor = createMock();
+ const messageEmbedAuthor: MessageEmbedAuthor = createHydratedMock();
discordSoniaServiceGetCorporationMessageEmbedAuthorSpy.mockReturnValue(messageEmbedAuthor);
const result = service.getErrorMessageResponse(error);
diff --git a/src/features/discord/logger/services/discord-logger-warning.service.spec.ts b/src/features/discord/logger/services/discord-logger-warning.service.spec.ts
index dfb5f9248..54005060e 100644
--- a/src/features/discord/logger/services/discord-logger-warning.service.spec.ts
+++ b/src/features/discord/logger/services/discord-logger-warning.service.spec.ts
@@ -12,7 +12,7 @@ import { DiscordMessageConfigService } from '../../messages/services/config/disc
import { DiscordSoniaService } from '../../users/services/discord-sonia.service';
import { MessageEmbedAuthor } from 'discord.js';
import moment from 'moment-timezone';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -83,7 +83,7 @@ describe(`DiscordLoggerWarningService`, (): void => {
beforeEach((): void => {
service = new DiscordLoggerWarningService();
warning = `dummy-warning`;
- discordMessageResponse = createMock();
+ discordMessageResponse = createHydratedMock();
loggerServiceWarningSpy = jest.spyOn(loggerService, `warning`).mockImplementation();
loggerServiceDebugSpy = jest.spyOn(loggerService, `debug`).mockImplementation();
@@ -166,7 +166,7 @@ describe(`DiscordLoggerWarningService`, (): void => {
it(`should return a warning message response with an embed author`, (): void => {
expect.assertions(1);
- const messageEmbedAuthor: MessageEmbedAuthor = createMock();
+ const messageEmbedAuthor: MessageEmbedAuthor = createHydratedMock();
discordSoniaServiceGetCorporationMessageEmbedAuthorSpy.mockReturnValue(messageEmbedAuthor);
const result = service.getWarningMessageResponse(warning);
diff --git a/src/features/discord/logger/services/discord-logger.service.spec.ts b/src/features/discord/logger/services/discord-logger.service.spec.ts
index fad0e8422..b0c5dcd04 100644
--- a/src/features/discord/logger/services/discord-logger.service.spec.ts
+++ b/src/features/discord/logger/services/discord-logger.service.spec.ts
@@ -7,7 +7,7 @@ import { ILoggerLog } from '../../../logger/interfaces/logger-log';
import { LoggerService } from '../../../logger/services/logger.service';
import { DiscordClientService } from '../../services/discord-client.service';
import { Client } from 'discord.js';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
jest.mock(`../../../logger/services/chalk/chalk.service`);
@@ -76,7 +76,7 @@ describe(`DiscordLoggerService`, (): void => {
beforeEach((): void => {
service = new DiscordLoggerService();
discordClientServiceGetClientOnMock = jest.fn();
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -114,7 +114,7 @@ describe(`DiscordLoggerService`, (): void => {
discordClientServiceGetClientOnMock = jest.fn((_event: string, listener: () => void): void => {
listener();
});
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
@@ -157,7 +157,7 @@ describe(`DiscordLoggerService`, (): void => {
discordClientServiceGetClientOnMock = jest.fn((_event: string, listener: () => void): void => {
listener();
});
- client = createMock({
+ client = createHydratedMock({
on: discordClientServiceGetClientOnMock,
});
diff --git a/src/features/discord/messages/classes/commands/arguments/discord-command-first-argument.spec.ts b/src/features/discord/messages/classes/commands/arguments/discord-command-first-argument.spec.ts
index 1353eec8d..721441d8b 100644
--- a/src/features/discord/messages/classes/commands/arguments/discord-command-first-argument.spec.ts
+++ b/src/features/discord/messages/classes/commands/arguments/discord-command-first-argument.spec.ts
@@ -1,7 +1,7 @@
import { DiscordCommandFirstArgument } from './discord-command-first-argument';
import { IDiscordCommandFirstArgument } from '../../../interfaces/commands/discord-command-first-argument';
import { DiscordMessageCommandFeatureNameEnum } from '../../../services/command/feature/enums/discord-message-command-feature-name.enum';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
describe(`DiscordCommandFirstArgument`, (): void => {
let discordCommandFirstArgument: DiscordCommandFirstArgument;
@@ -12,7 +12,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
expect.assertions(1);
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
description: `dummy-description`,
})
);
@@ -26,7 +26,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
expect.assertions(1);
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
@@ -41,7 +41,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
expect.assertions(1);
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
shortcuts: undefined,
})
);
@@ -55,7 +55,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
expect.assertions(1);
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
shortcuts: [DiscordMessageCommandFeatureNameEnum.N],
})
);
@@ -69,7 +69,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`getDescription()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -86,7 +86,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`setDescription()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -102,7 +102,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`getName()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -119,7 +119,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`getLowerCaseName()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -136,7 +136,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`setName()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -152,7 +152,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`getShortcuts()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -169,7 +169,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`getLowerCaseShortcuts()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -189,7 +189,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`setShortcuts()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>()
+ createHydratedMock>()
);
});
@@ -205,7 +205,7 @@ describe(`DiscordCommandFirstArgument`, (): void => {
describe(`getLowerCaseNameAndShortcutsExample()`, (): void => {
beforeEach((): void => {
discordCommandFirstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
diff --git a/src/features/discord/messages/classes/commands/arguments/discord-command-first-arguments.spec.ts b/src/features/discord/messages/classes/commands/arguments/discord-command-first-arguments.spec.ts
index 5d0cee3d8..cfefa8146 100644
--- a/src/features/discord/messages/classes/commands/arguments/discord-command-first-arguments.spec.ts
+++ b/src/features/discord/messages/classes/commands/arguments/discord-command-first-arguments.spec.ts
@@ -2,7 +2,7 @@ import { DiscordCommandFirstArgument } from './discord-command-first-argument';
import { DiscordCommandFirstArguments } from './discord-command-first-arguments';
import { IDiscordCommandFirstArgument } from '../../../interfaces/commands/discord-command-first-argument';
import { DiscordMessageCommandFeatureNameEnum } from '../../../services/command/feature/enums/discord-message-command-feature-name.enum';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
describe(`DiscordCommandFirstArguments`, (): void => {
let discordCommandFirstArguments: DiscordCommandFirstArguments;
@@ -11,7 +11,9 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`when the class is created with some arguments`, (): void => {
it(`should update the arguments inside the class`, (): void => {
expect.assertions(1);
- const firstArguments = createMock[]>();
+ const firstArguments = createHydratedMock<
+ DiscordCommandFirstArgument[]
+ >();
discordCommandFirstArguments = new DiscordCommandFirstArguments(
firstArguments
@@ -25,13 +27,13 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getArguments()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
it(`should return the arguments`, (): void => {
expect.assertions(1);
- const firstArguments = createMock[]>();
+ const firstArguments = createHydratedMock[]>();
discordCommandFirstArguments.setArguments(firstArguments);
const result = discordCommandFirstArguments.getArguments();
@@ -43,13 +45,13 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`setArguments()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
it(`should update the arguments with the given ones`, (): void => {
expect.assertions(1);
- const firstArguments = createMock[]>();
+ const firstArguments = createHydratedMock[]>();
discordCommandFirstArguments.setArguments(firstArguments);
@@ -60,7 +62,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getRandomArgument()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
@@ -82,7 +84,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
let firstArgument: DiscordCommandFirstArgument;
beforeEach((): void => {
- firstArgument = createMock>();
+ firstArgument = createHydratedMock>();
discordCommandFirstArguments.setArguments([firstArgument]);
});
@@ -100,8 +102,8 @@ describe(`DiscordCommandFirstArguments`, (): void => {
let firstArgument2: DiscordCommandFirstArgument;
beforeEach((): void => {
- firstArgument1 = createMock>();
- firstArgument2 = createMock>();
+ firstArgument1 = createHydratedMock>();
+ firstArgument2 = createHydratedMock>();
discordCommandFirstArguments.setArguments([firstArgument1, firstArgument2]);
});
@@ -118,7 +120,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getRandomArgumentUsageExample()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
@@ -141,7 +143,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
@@ -161,7 +163,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getAllArgumentsNameExample()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
@@ -184,7 +186,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
@@ -206,12 +208,12 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument1 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
firstArgument2 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.N,
})
);
@@ -231,7 +233,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getAllArgumentsNameWithShortcutsExample()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
@@ -254,7 +256,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
@@ -275,7 +277,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
shortcuts: [DiscordMessageCommandFeatureNameEnum.N, DiscordMessageCommandFeatureNameEnum.N],
})
@@ -298,12 +300,12 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument1 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
firstArgument2 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.N,
})
);
@@ -325,13 +327,13 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument1 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
shortcuts: [DiscordMessageCommandFeatureNameEnum.N, DiscordMessageCommandFeatureNameEnum.N],
})
);
firstArgument2 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.N,
shortcuts: [DiscordMessageCommandFeatureNameEnum.N, DiscordMessageCommandFeatureNameEnum.N],
})
@@ -352,7 +354,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getAllArgumentsLowerCaseName()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
@@ -375,7 +377,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
@@ -397,12 +399,12 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument1 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
firstArgument2 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.N,
})
);
@@ -422,7 +424,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
describe(`getAllArgumentsLowerCaseNameWithShortcuts()`, (): void => {
beforeEach((): void => {
discordCommandFirstArguments = new DiscordCommandFirstArguments(
- createMock[]>()
+ createHydratedMock[]>()
);
});
@@ -445,7 +447,7 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
})
);
@@ -467,13 +469,13 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument1 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
shortcuts: [DiscordMessageCommandFeatureNameEnum.N],
})
);
firstArgument2 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.N,
shortcuts: [DiscordMessageCommandFeatureNameEnum.NOON],
})
@@ -496,13 +498,13 @@ describe(`DiscordCommandFirstArguments`, (): void => {
beforeEach((): void => {
firstArgument1 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.NOON,
shortcuts: [DiscordMessageCommandFeatureNameEnum.N, DiscordMessageCommandFeatureNameEnum.N],
})
);
firstArgument2 = new DiscordCommandFirstArgument(
- createMock>({
+ createHydratedMock>({
name: DiscordMessageCommandFeatureNameEnum.N,
shortcuts: [DiscordMessageCommandFeatureNameEnum.NOON, DiscordMessageCommandFeatureNameEnum.NOON],
})
diff --git a/src/features/discord/messages/classes/commands/flags/discord-command-boolean-flag.spec.ts b/src/features/discord/messages/classes/commands/flags/discord-command-boolean-flag.spec.ts
index 5e6c8273e..750ed57de 100644
--- a/src/features/discord/messages/classes/commands/flags/discord-command-boolean-flag.spec.ts
+++ b/src/features/discord/messages/classes/commands/flags/discord-command-boolean-flag.spec.ts
@@ -7,7 +7,7 @@ import { IDiscordCommandFlagSuccess } from '../../../interfaces/commands/flags/d
import { IDiscordCommandFlag } from '../../../interfaces/commands/flags/discord-command-flag';
import { IAnyDiscordMessage } from '../../../types/any-discord-message';
import { IDiscordMessageFlag } from '../../../types/commands/flags/discord-message-flag';
-import { createMock } from 'ts-auto-mock';
+import { createHydratedMock } from 'ts-auto-mock';
enum DummyFlagEnum {
ALPHA = `alpha-flag`,
@@ -22,12 +22,13 @@ describe(`DiscordCommandBooleanFlag`, (): void => {
describe(`when the class is created with an action`, (): void => {
it(`should update the action inside the class`, (): void => {
expect.assertions(1);
- const action = createMock>({
- execute: (): Promise => Promise.resolve(createMock()),
+ const action = createHydratedMock>({
+ execute: (): Promise =>
+ Promise.resolve(createHydratedMock()),
});
discordCommandFlag = new DiscordCommandBooleanFlag(
- createMock>>({
+ createHydratedMock>>({
action,
})
);
@@ -41,7 +42,7 @@ describe(`DiscordCommandBooleanFlag`, (): void => {
expect.assertions(1);
discordCommandFlag = new DiscordCommandBooleanFlag