Feature/12 create tests #102
7 changed files with 2 additions and 64 deletions
|
@ -1,7 +0,0 @@
|
|||
import { Command } from "../../../src/type/command";
|
||||
|
||||
export default class noCategory extends Command {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
import { Command } from "../../../src/type/command";
|
||||
|
||||
export default class normal extends Command {
|
||||
constructor() {
|
||||
super();
|
||||
this._category = "General";
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
import { Command } from "../../../src/type/command";
|
||||
|
||||
export default class roles extends Command {
|
||||
constructor() {
|
||||
super();
|
||||
this._roles = [ "Moderator" ];
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
import { Event } from "../../../src/type/event";
|
||||
|
||||
export class normal extends Event {
|
||||
public override channelCreate() {}
|
||||
}
|
|
@ -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");
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
@ -23,9 +23,6 @@ describe('LoadCommand', () => {
|
|||
FOLDERS_EVENTS: 'events',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -62,9 +59,6 @@ describe('LoadCommand', () => {
|
|||
FOLDERS_EVENTS: 'events',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: null
|
||||
} as unknown as Message;
|
||||
|
@ -95,9 +89,6 @@ describe('LoadCommand', () => {
|
|||
FOLDERS_EVENTS: 'events',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -134,9 +125,6 @@ describe('LoadCommand', () => {
|
|||
FOLDERS_EVENTS: 'events',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -177,9 +165,6 @@ describe('LoadCommand', () => {
|
|||
COMMANDS_DISABLED_MESSAGE: 'disabled',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -221,9 +206,6 @@ describe('LoadCommand', () => {
|
|||
COMMANDS_DISABLED: 'test',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -265,9 +247,6 @@ describe('LoadCommand', () => {
|
|||
COMMANDS_DISABLED: 'other',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -311,9 +290,6 @@ describe('LoadCommand', () => {
|
|||
FOLDERS_EVENTS: 'events',
|
||||
}
|
||||
|
||||
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
|
||||
fs.existsSync = jest.fn().mockReturnValue(true);
|
||||
|
||||
const message = {
|
||||
member: {
|
||||
roles: {
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue