import { beforeEach, expect, test, vi } from "vitest"; import { channelOnly } from "src/plugins"; import { AnyCommandPlugin, CommandType, Context, commandModule } from "@sern/handler"; import { Client, ClientOptions, Collection } from "discord.js"; function CMD(...plugins: AnyCommandPlugin[]) { return commandModule({ description: "", type: CommandType.Both, plugins, execute() {}, }); } vi.mock("src/plugins"); vi.mock("discord.js", () => { const Client = vi.fn(); return { Client }; }); const client = new Client({ intents: ["Guilds", "GuildMessages", "MessageContent"] }); test("channelOnly plugin", () => { console.log(client); });