diff --git a/tests/__mocks/commands/noCategory.ts b/tests/__mocks/commands/noCategory.ts deleted file mode 100644 index e71cd53..0000000 --- a/tests/__mocks/commands/noCategory.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Command } from "../../../src/type/command"; - -export default class noCategory extends Command { - constructor() { - super(); - } -} diff --git a/tests/__mocks/commands/normal.ts b/tests/__mocks/commands/normal.ts deleted file mode 100644 index 3e3a74f..0000000 --- a/tests/__mocks/commands/normal.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Command } from "../../../src/type/command"; - -export default class normal extends Command { - constructor() { - super(); - this._category = "General"; - } -} diff --git a/tests/__mocks/commands/roles.ts b/tests/__mocks/commands/roles.ts deleted file mode 100644 index 1e0321e..0000000 --- a/tests/__mocks/commands/roles.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Command } from "../../../src/type/command"; - -export default class roles extends Command { - constructor() { - super(); - this._roles = [ "Moderator" ]; - } -} diff --git a/tests/__mocks/events/normal.ts b/tests/__mocks/events/normal.ts deleted file mode 100644 index 8a85eaa..0000000 --- a/tests/__mocks/events/normal.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Event } from "../../../src/type/event"; - -export class normal extends Event { - public override channelCreate() {} -} \ No newline at end of file diff --git a/tests/client/client.test.ts b/tests/client/client.test.ts index bf826d1..46879ba 100644 --- a/tests/client/client.test.ts +++ b/tests/client/client.test.ts @@ -5,9 +5,7 @@ import * as dotenv from "dotenv"; import { Events } from "../../src/client/events"; import { Util } from "../../src/client/util"; import { Command } from "../../src/type/command"; -import ICommandItem from "../../src/contracts/ICommandItem"; import { mock } from "jest-mock-extended"; -import IEventItem from "../../src/contracts/IEventItem"; import { Event } from "../../src/type/event"; jest.mock("discord.js"); diff --git a/tests/client/events.test.ts b/tests/client/events.test.ts index a6029fc..50eb557 100644 --- a/tests/client/events.test.ts +++ b/tests/client/events.test.ts @@ -1,5 +1,5 @@ import { Events } from "../../src/client/events"; -import { Message, Client, TextChannel, Guild, SnowflakeUtil, DMChannel } from "discord.js"; +import { Message } from "discord.js"; import { Util } from "../../src/client/util"; import ICommandItem from "../../src/contracts/ICommandItem"; import { Command } from "../../src/type/command"; diff --git a/tests/client/util.test.ts b/tests/client/util.test.ts index b1da815..6429e24 100644 --- a/tests/client/util.test.ts +++ b/tests/client/util.test.ts @@ -1,6 +1,6 @@ import { Util } from "../../src/client/util"; -import { Client, Guild, Message, Role, SnowflakeUtil, TextChannel, User } from "discord.js"; +import { Client, Message } from "discord.js"; import fs from "fs"; import { mock } from "jest-mock-extended"; import { Command } from "../../src/type/command"; @@ -22,9 +22,6 @@ describe('LoadCommand', () => { FOLDERS_COMMANDS: 'commands', FOLDERS_EVENTS: 'events', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -61,9 +58,6 @@ describe('LoadCommand', () => { FOLDERS_COMMANDS: 'commands', FOLDERS_EVENTS: 'events', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: null @@ -94,9 +88,6 @@ describe('LoadCommand', () => { FOLDERS_COMMANDS: 'commands', FOLDERS_EVENTS: 'events', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -133,9 +124,6 @@ describe('LoadCommand', () => { FOLDERS_COMMANDS: 'commands', FOLDERS_EVENTS: 'events', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -176,9 +164,6 @@ describe('LoadCommand', () => { COMMANDS_DISABLED: 'test', COMMANDS_DISABLED_MESSAGE: 'disabled', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -220,9 +205,6 @@ describe('LoadCommand', () => { FOLDERS_EVENTS: 'events', COMMANDS_DISABLED: 'test', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -264,9 +246,6 @@ describe('LoadCommand', () => { FOLDERS_EVENTS: 'events', COMMANDS_DISABLED: 'other', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -310,9 +289,6 @@ describe('LoadCommand', () => { FOLDERS_COMMANDS: 'commands', FOLDERS_EVENTS: 'events', } - - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); const message = { member: { @@ -346,10 +322,6 @@ describe('LoadEvents', () => { FOLDERS_EVENTS: 'events', } - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); - fs.readdirSync = jest.fn().mockReturnValue(["normal.ts"]); - const client = { on: jest.fn(), } as unknown as Client; @@ -380,10 +352,6 @@ describe('LoadEvents', () => { FOLDERS_EVENTS: 'events', } - process.cwd = jest.fn().mockReturnValue("../../tests/__mocks"); - fs.existsSync = jest.fn().mockReturnValue(true); - fs.readdirSync = jest.fn().mockReturnValue(["normal"]); - const client = { on: jest.fn(), } as unknown as Client;