refactor: update command tests to use require syntax and improve error handling
Deploy to NAS / deploy (push) Successful in 1m4s
Deploy to NAS / deploy (push) Successful in 1m4s
This commit is contained in:
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user