Skip to content

Commit ee87ce2

Browse files
test(discord): avoid unbound hydration mock
1 parent 78747c2 commit ee87ce2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

extensions/discord/src/monitor/message-handler.hydration.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ describe("hydrateDiscordMessageIfNeeded", () => {
171171
it("keeps the original reply message when hydration fetch fails", async () => {
172172
const client = createInternalTestClient();
173173
const rest = createFakeRestClient();
174-
rest.get = vi.fn(async () => {
174+
const get = vi.fn(async () => {
175175
throw Object.assign(new Error("Missing Access"), { status: 403 });
176176
});
177+
rest.get = get;
177178
const message = new Message(client, {
178179
id: "m1",
179180
channel_id: "c1",
@@ -207,7 +208,7 @@ describe("hydrateDiscordMessageIfNeeded", () => {
207208
messageChannelId: "c1",
208209
});
209210

210-
expect(rest.get).toHaveBeenCalledOnce();
211+
expect(get).toHaveBeenCalledOnce();
211212
expect(hydrated).toBe(message);
212213
expect(hydrated.referencedMessage).toBeNull();
213214
});

0 commit comments

Comments
 (0)