Add constructor test
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ethan Lane 2023-03-25 15:16:01 +00:00
parent d26f0d98d2
commit bd5515c587
3 changed files with 950 additions and 940 deletions

View file

@ -31,17 +31,17 @@
"discord.js": "^14.3.0", "discord.js": "^14.3.0",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"emoji-regex": "^9.2.0", "emoji-regex": "^9.2.0",
"jest": "^27.4.5", "jest": "^29.5.0",
"jest-mock-extended": "^3.0.0", "jest-mock-extended": "^3.0.4",
"minimatch": "7.4.2", "minimatch": "7.4.2",
"mysql": "^2.18.1", "mysql": "^2.18.1",
"random-bunny": "^2.0.5", "random-bunny": "^2.0.5",
"ts-jest": "^27.1.2", "ts-jest": "^29.0.5",
"typeorm": "^0.2.44", "typeorm": "^0.2.44",
"uuid": "^9.0.0" "uuid": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.0.0", "@types/node": "^18.0.0",
"typescript": "^5.0.0" "typescript": "^5.0.2"
} }
} }

View file

@ -0,0 +1,16 @@
import { PermissionsBitField, SlashCommandBuilder } from "discord.js";
import Timeout from "../../src/commands/timeout";
describe('Constructor', () => {
test('Expect CommandBuilder to be configured', () => {
const command = new Timeout();
expect(command.CommandBuilder).toBeDefined();
const commandBuilder = command.CommandBuilder as SlashCommandBuilder;
expect(commandBuilder.name).toBe("timeout");
expect(commandBuilder.description).toBe("Timeouts a user out, sending them a DM with the reason if possible");
expect(commandBuilder.options.length).toBe(3);
});
});

1866
yarn.lock

File diff suppressed because it is too large Load diff