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

@ -26,12 +26,10 @@
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.24", "@types/jest": "^26.0.24",
"@types/node": "^16.3.2", "@types/node": "^16.3.2",
"@types/proxyquire": "^1.3.28",
"@typescript-eslint/eslint-plugin": "^4.29.2", "@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2", "@typescript-eslint/parser": "^4.29.2",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"jest": "^27.0.6", "jest": "^27.0.6",
"proxyquire": "^2.1.3",
"ts-jest": "^27.0.4", "ts-jest": "^27.0.4",
"typescript": "^4.3.5" "typescript": "^4.3.5"
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -675,11 +675,6 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3"
integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog==
"@types/proxyquire@^1.3.28":
version "1.3.28"
resolved "https://registry.yarnpkg.com/@types/proxyquire/-/proxyquire-1.3.28.tgz#05a647bb0d8fe48fc8edcc193e43cc79310faa7d"
integrity sha512-SQaNzWQ2YZSr7FqAyPPiA3FYpux2Lqh3HWMZQk47x3xbMCqgC/w0dY3dw9rGqlweDDkrySQBcaScXWeR+Yb11Q==
"@types/stack-utils@^2.0.0": "@types/stack-utils@^2.0.0":
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
@ -1522,14 +1517,6 @@ file-entry-cache@^6.0.1:
dependencies: dependencies:
flat-cache "^3.0.4" flat-cache "^3.0.4"
fill-keys@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/fill-keys/-/fill-keys-1.0.2.tgz#9a8fa36f4e8ad634e3bf6b4f3c8882551452eb20"
integrity sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=
dependencies:
is-object "~1.0.1"
merge-descriptors "~1.0.0"
fill-range@^7.0.1: fill-range@^7.0.1:
version "7.0.1" version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
@ -1798,11 +1785,6 @@ is-number@^7.0.0:
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
is-object@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf"
integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==
is-potential-custom-element-name@^1.0.1: is-potential-custom-element-name@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
@ -2440,11 +2422,6 @@ makeerror@1.0.x:
dependencies: dependencies:
tmpl "1.0.x" tmpl "1.0.x"
merge-descriptors@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=
merge-stream@^2.0.0: merge-stream@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@ -2497,11 +2474,6 @@ mkdirp@1.x:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
module-not-found-error@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/module-not-found-error/-/module-not-found-error-1.0.1.tgz#cf8b4ff4f29640674d6cdd02b0e3bc523c2bbdc0"
integrity sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=
ms@2.1.2: ms@2.1.2:
version "2.1.2" version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@ -2715,15 +2687,6 @@ prompts@^2.0.1:
kleur "^3.0.3" kleur "^3.0.3"
sisteransi "^1.0.5" sisteransi "^1.0.5"
proxyquire@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/proxyquire/-/proxyquire-2.1.3.tgz#2049a7eefa10a9a953346a18e54aab2b4268df39"
integrity sha512-BQWfCqYM+QINd+yawJz23tbBM40VIGXOdDw3X344KcclI/gtBbdWF6SlQ4nK/bYhF9d27KYug9WzljHC6B9Ysg==
dependencies:
fill-keys "^1.0.2"
module-not-found-error "^1.0.1"
resolve "^1.11.1"
psl@^1.1.33: psl@^1.1.33:
version "1.8.0" version "1.8.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
@ -2776,7 +2739,7 @@ resolve-from@^5.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
resolve@^1.11.1, resolve@^1.20.0: resolve@^1.20.0:
version "1.20.0" version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==