Upgrade discord.js
All checks were successful
Test / build (push) Successful in 53s

This commit is contained in:
Ethan Lane 2025-06-19 19:14:40 +01:00
parent 983195c477
commit 2bf961d1e5
32 changed files with 88 additions and 106 deletions

View file

@ -1,7 +1,7 @@
import { CommandInteraction } from "discord.js";
import { ChatInputCommandInteraction } from "discord.js";
import Drop from "../../src/commands/drop";
import GenerateCommandInteractionMock from "../__functions__/discord.js/GenerateCommandInteractionMock";
import { CommandInteraction as CommandInteractionMock } from "../__types__/discord.js";
import { ChatInputCommandInteraction as ChatInputCommandInteractionMock } from "../__types__/discord.js";
import { CoreClient } from "../../src/client/client";
import Config from "../../src/database/entities/app/Config";
import User from "../../src/database/entities/app/User";
@ -25,7 +25,7 @@ beforeEach(() => {
describe("execute", () => {
describe("GIVEN user is in the database", () => {
let interaction: CommandInteractionMock;
let interaction: ChatInputCommandInteractionMock;
let user: User;
const randomCard = {
card: {
@ -62,7 +62,7 @@ describe("execute", () => {
// Act
const drop = new Drop();
await drop.execute(interaction as unknown as CommandInteraction);
await drop.execute(interaction as unknown as ChatInputCommandInteraction);
});
test("EXPECT user to be fetched", () => {

View file

@ -4,7 +4,7 @@ import Use from "../../src/commands/effects/Use";
import Buy from "../../src/commands/effects/Buy";
import AppLogger from "../../src/client/appLogger";
import GenerateCommandInteractionMock from "../__functions__/discord.js/GenerateCommandInteractionMock";
import { CommandInteraction } from "discord.js";
import { ChatInputCommandInteraction } from "discord.js";
jest.mock("../../src/commands/effects/List");
jest.mock("../../src/commands/effects/Use");
@ -32,7 +32,7 @@ describe("execute", () => {
// Act
const effects = new Effects();
await effects.execute(interaction as unknown as CommandInteraction);
await effects.execute(interaction as unknown as ChatInputCommandInteraction);
// Assert
expect(List).toHaveBeenCalledTimes(1);
@ -52,7 +52,7 @@ describe("execute", () => {
// Act
const effects = new Effects();
await effects.execute(interaction as unknown as CommandInteraction);
await effects.execute(interaction as unknown as ChatInputCommandInteraction);
// Assert
expect(Use).toHaveBeenCalledTimes(1);
@ -72,7 +72,7 @@ describe("execute", () => {
// Act
const effects = new Effects();
await effects.execute(interaction as unknown as CommandInteraction);
await effects.execute(interaction as unknown as ChatInputCommandInteraction);
// Assert
expect(Buy).toHaveBeenCalledTimes(1);
@ -92,7 +92,7 @@ describe("execute", () => {
// Act
const effects = new Effects();
await effects.execute(interaction as unknown as CommandInteraction);
await effects.execute(interaction as unknown as ChatInputCommandInteraction);
// Assert
expect(AppLogger.LogError).toHaveBeenCalledTimes(1);