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
+3 -2
View File
@@ -12,7 +12,8 @@ jest.mock('discord.js', () => ({
}),
}));
const pingCommand = require('../../commands/ping');
const PingCommand = require('../../commands/ping').default;
const pingCommand = new PingCommand();
describe('Ping Command', () => {
describe('Command Structure', () => {
@@ -47,7 +48,7 @@ describe('Ping Command', () => {
it('should handle interaction reply failure', async () => {
// Mock a failed reply
interaction.reply.mockRejectedValueOnce(new Error('Failed to reply'));
interaction.reply.mockRejectedValue(new Error('Failed to reply'));
await expect(pingCommand.execute(interaction)).rejects.toThrow(
'Failed to reply',