refactor: update command tests to use require syntax and improve error handling
Deploy to NAS / deploy (push) Successful in 1m4s

This commit is contained in:
2025-12-25 10:28:44 -05:00
parent b362a43886
commit 06ac40a6d7
7 changed files with 33 additions and 25 deletions
+4 -3
View File
@@ -39,7 +39,8 @@ jest.mock('discord.js', () => ({
},
}));
const pruneCommand = require('../../commands/prune');
const PruneCommand = require('../../commands/prune').default;
const pruneCommand = new PruneCommand();
describe('Prune Command', () => {
describe('Command Structure', () => {
@@ -103,7 +104,7 @@ describe('Prune Command', () => {
await pruneCommand.execute(interaction);
expect(interaction.reply).toHaveBeenCalledWith({
content: 'There was an error trying to prune messages in this channel!',
content: 'Command failed: Failed to delete messages',
ephemeral: true,
});
});
@@ -116,7 +117,7 @@ describe('Prune Command', () => {
await pruneCommand.execute(interaction);
expect(interaction.reply).toHaveBeenCalledWith({
content: 'There was an error trying to prune messages in this channel!',
content: 'Command failed: Messages older than 14 days cannot be deleted',
ephemeral: true,
});
});