Improvements

This commit is contained in:
Ethan Lane 2021-08-21 15:20:40 +01:00
parent 044140d58d
commit bb848dcec3
6 changed files with 10 additions and 50 deletions

View file

@ -3,6 +3,5 @@ import { Command } from "../../../src/type/command";
export class noCategory extends Command {
constructor() {
super();
}
}

View file

@ -1,6 +1,6 @@
import { Command } from "../../../src/type/command";
export class name extends Command {
export class normal extends Command {
constructor() {
super();
this._category = "General";

View file

@ -1,5 +1,5 @@
import { Event } from "../../../src/type/event";
export class name extends Event {
export class normal extends Event {
public override channelCreate() {}
}

View file

@ -33,7 +33,7 @@ test('LoadCommand_GivenSuccessfulExection_ExpectSuccessfulResult', () => {
const util = new Util();
const result = util.loadCommand("name", [ "first" ], message);
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeTruthy();
});
@ -55,7 +55,7 @@ test('LoadCommand_GivenMemberIsNull_ExpectFailedResult', () => {
const util = new Util();
const result = util.loadCommand("name", [ "first" ], message);
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Member is not part of message");
@ -85,7 +85,7 @@ test('LoadCommand_GivenFolderDoesNotExist_ExpectFailedResult', () => {
const util = new Util();
const result = util.loadCommand("name", [ "first" ], message);
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Command folder does not exist");
@ -116,7 +116,7 @@ test('LoadCommand_GivenFileDoesNotExist_ExpectFailedResult', () => {
const util = new Util();
const result = util.loadCommand("name", [ "first" ], message);
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("File does not exist");
@ -220,7 +220,7 @@ test('LoadEvents_GivenEventsAreLoaded_ExpectSuccessfulResult', () => {
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
fs.readdirSync = jest.fn().mockReturnValue(["name.ts"]);
fs.readdirSync = jest.fn().mockReturnValue(["normal.ts"]);
const client = {
on: jest.fn(),
@ -246,7 +246,7 @@ test('LoadEvents_GivenNoEventsFound_ExpectSuccessfulResultStill', () => {
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
fs.readdirSync = jest.fn().mockReturnValue(["name"]);
fs.readdirSync = jest.fn().mockReturnValue(["normal"]);
const client = {
on: jest.fn(),
@ -272,7 +272,7 @@ test('LoadEvents_GivenEventFolderDoesNotExist_FailedResult', () => {
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(false);
fs.readdirSync = jest.fn().mockReturnValue(["name.ts"]);
fs.readdirSync = jest.fn().mockReturnValue(["normal.ts"]);
const client = {
on: jest.fn(),