/[sudobot]/trunk/tests/utils/emoji.test.ts
ViewVC logotype

Contents of /trunk/tests/utils/emoji.test.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 575 - (show annotations)
Mon Jul 29 17:59:26 2024 UTC (8 months ago) by rakinar2
File MIME type: application/typescript
File size: 1132 byte(s)
chore: add trunk
1 import type BaseClient from "@framework/client/BaseClient";
2 import { emoji } from "@framework/utils/emoji";
3 import { Collection, GuildEmoji } from "discord.js";
4 import { beforeEach, describe, expect, it } from "vitest";
5 import { createClient } from "../mocks/client.mock";
6 import { createGuild } from "../mocks/guild.mock";
7
8 describe("emoji", () => {
9 let client: BaseClient;
10
11 beforeEach(() => {
12 client = {
13 ...createClient(),
14 emojis: {
15 cache: new Collection()
16 }
17 } as unknown as BaseClient;
18 });
19
20 it("should return the emoji", () => {
21 const testEmoji = {
22 id: "emoji",
23 name: "emoji",
24 animated: false,
25 available: true,
26 createdAt: new Date(),
27 createdTimestamp: 0,
28 guild: createGuild(),
29 identifier: "emoji",
30 url: "emoji",
31 toString() {
32 return "emoji";
33 }
34 } as GuildEmoji;
35 client.emojis.cache.set("emoji", testEmoji);
36 expect(emoji(client, "emoji")).toBe(testEmoji);
37 });
38 });

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26