Tests and CI #44

Merged
Vylpes merged 17 commits from feature/tests into develop 2021-08-21 16:00:28 +01:00
16 changed files with 3810 additions and 55 deletions

View file

@ -1 +1,2 @@
tests
node_modules
dist

View file

@ -1,44 +1,14 @@
{
"parserOptions": {
"ecmaVersion": 6
},
"extends": [
"eslint:recommended"
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"camelcase": "error",
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": [
"error",
"never"
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"comma-style": [
"error",
"last"
],
"arrow-body-style": [
"error",
"as-needed"
],
"arrow-parens": [
"error",
"as-needed"
],
"arrow-spacing": "error",
"no-var": "error",
"prefer-template": "error",
"prefer-const": "error"
},
"globals": {
"exports": "writable",
"module": "writable",
@ -46,4 +16,4 @@
"process": "writable",
"console": "writable"
}
}
}

4
.gitignore vendored
View file

@ -108,8 +108,8 @@ commands/
events/
/bot.ts
!tests/commands/
!tests/events/
!tests/__mocks/commands
!tests/__mocks/events
# Linux Environment Files
*.swp

View file

@ -1,3 +1,5 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
testEnvironment: 'node'
}
preset: 'ts-jest',
testEnvironment: 'node',
};

View file

@ -6,8 +6,7 @@
"scripts": {
"build": "tsc",
"test": "jest --coverage",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
"lint": "eslint ."
},
"author": "Vylpes",
"license": "MIT",
@ -25,7 +24,13 @@
],
"repository": "github:vylpes/vylbot-core",
"devDependencies": {
"@types/jest": "^26.0.24",
"@types/node": "^16.3.2",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
"eslint": "^7.32.0",
"jest": "^27.0.6",
"ts-jest": "^27.0.4",
"typescript": "^4.3.5"
}
}

View file

@ -21,11 +21,6 @@ export class Events {
// Emit when a message is sent
// Used to check for commands
public onMessage(message: Message): IEventResponse {
if (!message) return {
valid: false,
message: "Message was not supplied.",
};
if (!message.guild) return {
valid: false,
message: "Message was not sent in a guild, ignoring.",
@ -50,7 +45,7 @@ export class Events {
const res = this._util.loadCommand(name, args, message);
if (!res.valid) {
if (res.message != 'File does not exist') return {
return {
valid: false,
message: res.message,
};

View file

@ -70,7 +70,7 @@ export class Util {
} else {
return {
valid: false,
message: "Comamnd folder does not exist",
message: "Command folder does not exist",
}
}
}

View file

@ -0,0 +1,7 @@
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
import { Command } from "../../../src/type/command";
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
export class noCategory extends Command {
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
constructor() {
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
super();
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
}
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line
}
VylpesTester commented 2021-08-21 15:06:40 +01:00 (Migrated from github.com)
Review

Empty line

Empty line

View file

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

View file

@ -0,0 +1,8 @@
import { Command } from "../../../src/type/command";
export class roles extends Command {
constructor() {
super();
this._roles = [ "Moderator" ];
}
}

View file

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

139
tests/client/client.test.ts Normal file
View file

@ -0,0 +1,139 @@
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
import { CoreClient } from "../../src/client/client";
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
import { Client } from "discord.js";
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
import * as dotenv from "dotenv";
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
import { Events } from "../../src/client/events";
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
import { Util } from "../../src/client/util";
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
jest.mock("discord.js");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
jest.mock("dotenv");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
jest.mock("../../src/client/events");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
jest.mock("../../src/client/util");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
describe('Constructor', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Constructor_ExpectSuccessfulInitialisation', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(coreClient).toBeInstanceOf(Client);
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(dotenv.config).toBeCalledTimes(1);
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(Events).toBeCalledTimes(1);
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(Util).toBeCalledTimes(1);
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
describe('Start', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given Env Is Valid, Expect Successful Start', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).not.toThrow();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(coreClient.on).toBeCalledWith("message", expect.any(Function));
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(coreClient.on).toBeCalledWith("ready", expect.any(Function));
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given BOT_TOKEN Is Null, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("BOT_TOKEN is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given BOT_TOKEN Is Empty, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: '',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("BOT_TOKEN is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given BOT_PREFIX Is Null, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("BOT_PREFIX is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given BOT_PREFIX Is Empty, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("BOT_PREFIX is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given FOLDERS_COMMANDS Is Null, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("FOLDERS_COMMANDS is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given FOLDERS_COMMANDS Is Empty, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: '',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: 'events',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("FOLDERS_COMMANDS is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given FOLDERS_EVENTS Is Null, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("FOLDERS_EVENTS is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
test('Given FOLDERS_EVENTS Is Empty, Expect Failure', () => {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
process.env = {
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_TOKEN: 'TOKEN',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
BOT_PREFIX: '!',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_COMMANDS: 'commands',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
FOLDERS_EVENTS: '',
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
}
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
const coreClient = new CoreClient();
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
expect(() => coreClient.start()).toThrow("FOLDERS_EVENTS is not defined in .env");
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also
});
VylpesTester commented 2021-08-21 15:10:11 +01:00 (Migrated from github.com)
Review

Should these be put into a describe group?

Should these be put into a describe group?
VylpesTester commented 2021-08-21 15:10:21 +01:00 (Migrated from github.com)
Review

This would apply to all other tests also

This would apply to all other tests also

185
tests/client/events.test.ts Normal file
View file

@ -0,0 +1,185 @@
import { Events } from "../../src/client/events";
import { Message, Client, TextChannel, Guild, SnowflakeUtil, DMChannel } from "discord.js";
import { Util } from "../../src/client/util";
jest.mock("../../src/client/util");
beforeEach(() => {
Util.prototype.loadCommand = jest.fn();
});
describe('OnMessage', () => {
test('Given Message Is Valid Expect Message Sent', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
};
Util.prototype.loadCommand = jest.fn().mockReturnValue({ valid: true });
const message = {
guild: {},
author: {
bot: false,
},
content: "!test first",
} as unknown as Message;
const events = new Events();
const result = events.onMessage(message);
expect(result.valid).toBeTruthy();
expect(result.context?.prefix).toBe('!');
expect(result.context?.name).toBe('test');
expect(result.context?.args.length).toBe(1);
expect(result.context?.args[0]).toBe('first');
expect(result.context?.message).toBe(message);
});
test('Given Guild Is Null, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
Util.prototype.loadCommand = jest.fn().mockReturnValue({ valid: true });
const message = {
guild: null,
author: {
bot: false,
},
content: "!test first",
} as unknown as Message;
const events = new Events();
const result = events.onMessage(message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Message was not sent in a guild, ignoring.");
});
test('Given Author Is A Bot, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
Util.prototype.loadCommand = jest.fn().mockReturnValue({ valid: true });
const message = {
guild: {},
author: {
bot: true,
},
content: "!test first",
} as unknown as Message;
const events = new Events();
const result = events.onMessage(message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Message was sent by a bot, ignoring.");
});
test('Given Message Content Was Not A Command, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
Util.prototype.loadCommand = jest.fn().mockReturnValue({ valid: true });
const message = {
guild: {},
author: {
bot: false,
},
content: "This is a standard message",
} as unknown as Message;
const events = new Events();
const result = events.onMessage(message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Message was not a command, ignoring.");
});
test('Given Message Had No Command Name, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
Util.prototype.loadCommand = jest.fn().mockReturnValue({ valid: true });
const message = {
guild: {},
author: {
bot: false,
},
content: "!",
} as unknown as Message;
const events = new Events();
const result = events.onMessage(message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Command name was not found");
});
test('Given Command Failed To Execute, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
Util.prototype.loadCommand = jest.fn().mockReturnValue({ valid: false, message: "Command failed" });
const message = {
guild: {},
author: {
bot: false,
},
content: "!test first",
} as unknown as Message;
const events = new Events();
const result = events.onMessage(message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Command failed");
});
});
describe('OnReady', () => {
test('Expect Console Log', () => {
console.log = jest.fn();
const events = new Events();
events.onReady();
expect(console.log).toBeCalledWith("Ready");
});
});

291
tests/client/util.test.ts Normal file
View file

@ -0,0 +1,291 @@
import { Util } from "../../src/client/util";
import { Client, Guild, Message, Role, SnowflakeUtil, TextChannel, User } from "discord.js";
import fs from "fs";
jest.mock("fs");
beforeEach(() => {
fs.existsSync = jest.fn();
});
describe('LoadCommand', () => {
test('Given Successful Exection, Expect Successful Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
const message = {
member: {
roles: {
cache: {
find: jest.fn().mockReturnValue(true),
}
},
},
reply: jest.fn(),
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeTruthy();
});
test('Given Member Is Null, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
const message = {
member: null
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Member is not part of message");
});
test('Given Folder Does Not Exist, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(false);
const message = {
member: {
roles: {
cache: {
find: jest.fn().mockReturnValue(true),
}
},
},
reply: jest.fn(),
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Command folder does not exist");
});
test('Given File Does Not Exist, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValueOnce(true)
.mockReturnValue(false);
const message = {
member: {
roles: {
cache: {
find: jest.fn().mockReturnValue(true),
}
},
},
reply: jest.fn(),
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("normal", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("File does not exist");
});
test('Given User Does Have Role, Expect Successful Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
const message = {
member: {
roles: {
cache: {
find: jest.fn().mockReturnValue(true),
}
},
},
reply: jest.fn(),
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("roles", [ "first" ], message);
expect(result.valid).toBeTruthy();
});
test('Given User Does Not Have Role, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
const message = {
member: {
roles: {
cache: {
find: jest.fn().mockReturnValue(false),
}
},
},
reply: jest.fn(),
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("roles", [ "first" ], message);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("You require the `Moderator` role to run this command");
});
test('Given Command Category Is Null, Expect Successful Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(true);
const message = {
member: {
roles: {
cache: {
find: jest.fn().mockReturnValue(true),
}
},
},
reply: jest.fn(),
} as unknown as Message;
const util = new Util();
const result = util.loadCommand("noCategory", [ "first" ], message);
expect(result.valid).toBeTruthy();
});
});
describe('LoadEvents', () => {
test('Given Events Are Loaded, Expect Successful Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
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;
const util = new Util();
const result = util.loadEvents(client);
const clientOn = jest.spyOn(client, 'on');
expect(result.valid).toBeTruthy();
expect(clientOn).toBeCalledTimes(13);
});
test('Given No Events Found, Expect Successful Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
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;
const util = new Util();
const result = util.loadEvents(client);
const clientOn = jest.spyOn(client, 'on');
expect(result.valid).toBeTruthy();
expect(clientOn).toBeCalledTimes(0);
});
test('Given Event Folder Does Not Exist, Expect Failed Result', () => {
process.env = {
BOT_TOKEN: 'TOKEN',
BOT_PREFIX: '!',
FOLDERS_COMMANDS: 'commands',
FOLDERS_EVENTS: 'events',
}
process.cwd = jest.fn().mockReturnValue("../../tests/__mocks");
fs.existsSync = jest.fn().mockReturnValue(false);
fs.readdirSync = jest.fn().mockReturnValue(["normal.ts"]);
const client = {
on: jest.fn(),
} as unknown as Client;
const util = new Util();
const result = util.loadEvents(client);
expect(result.valid).toBeFalsy();
expect(result.message).toBe("Event folder does not exist");
});
});

View file

@ -71,5 +71,8 @@
},
"include": [
"./src",
],
"exclude": [
"./tests"
]
}

3138
yarn.lock

File diff suppressed because it is too large Load diff