Skip to content

Commit b16fd6b

Browse files
committed
test(qqbot): fix channel api bounded body assertion
1 parent 51ebe87 commit b16fd6b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

extensions/qqbot/src/engine/tools/channel-api.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ describe("executeChannelApi", () => {
101101
status: 503,
102102
path: "/guilds/123/channels",
103103
});
104-
expect(JSON.stringify(result.details)).toContain("channel api unavailable");
105-
expect(JSON.stringify(result.details)).not.toContain("tail");
104+
const bodyPreview = (result.details as { details?: unknown }).details;
105+
expect(typeof bodyPreview).toBe("string");
106+
expect(bodyPreview).toContain("channel api unavailable");
107+
expect(bodyPreview).not.toContain("tail");
106108
expect(tracked.wasCanceled()).toBe(true);
107109
expect(textSpy).not.toHaveBeenCalled();
108110
expect(release).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)