Add some unit tests #321

Merged
Vylpes merged 3 commits from feature/15-unit-tests into develop 2024-07-26 18:31:06 +01:00
Showing only changes of commit 425266eed9 - Show all commits

View file

@ -16,7 +16,7 @@ describe("RegisterCommands", () => {
const commandFiles = getFilesInDirectory(path.join(process.cwd(), "src", "commands")) const commandFiles = getFilesInDirectory(path.join(process.cwd(), "src", "commands"))
.filter(x => x.endsWith(".ts")); .filter(x => x.endsWith(".ts"));
for (let file of commandFiles) { for (const file of commandFiles) {
expect(registeredCommands).toContain(file.split("/").pop()!.split(".")[0]); expect(registeredCommands).toContain(file.split("/").pop()!.split(".")[0]);
} }
@ -37,7 +37,7 @@ describe("RegisterButtonEvents", () => {
const eventFiles = getFilesInDirectory(path.join(process.cwd(), "src", "buttonEvents")) const eventFiles = getFilesInDirectory(path.join(process.cwd(), "src", "buttonEvents"))
.filter(x => x.endsWith(".ts")); .filter(x => x.endsWith(".ts"));
for (let file of eventFiles) { for (const file of eventFiles) {
expect(registeredButtonEvents).toContain(file.split("/").pop()!.split(".")[0].toLowerCase()); expect(registeredButtonEvents).toContain(file.split("/").pop()!.split(".")[0].toLowerCase());
} }