From 2e369804d3e6f5ed66d52b49510c0e3237bd169f Mon Sep 17 00:00:00 2001 From: penginn-net <121443048+penginn-net@users.noreply.github.com> Date: Fri, 10 Jan 2025 02:43:19 +0000 Subject: [PATCH] WIP --- .../test-federation/test/emoji.test.ts | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/backend/test-federation/test/emoji.test.ts b/packages/backend/test-federation/test/emoji.test.ts index 62a6006a04..a402bb1115 100644 --- a/packages/backend/test-federation/test/emoji.test.ts +++ b/packages/backend/test-federation/test/emoji.test.ts @@ -329,14 +329,21 @@ describe('Emoji', () => { assert(noteInB.emojis != null); assert(emoji.name in noteInB.emojis); strictEqual(noteInB.emojis[emoji.name], emoji.url); + // @ts-expect-error anyで警告が出るため const emojiId = (await bAdmin.client.request('admin/emoji/list-remote')).find( x => x.name === emoji.name).id; - let res:string; - try { - res = await bAdmin.client.request('admin/emoji/copy', {emojiId: emojiId}); - } catch (e) { - res = JSON.stringify(e); - } - console.log(JSON.stringify(res)); + let res = await fetch(`https://b.test/api/admin/emoji/copy`, { + method: 'POST', + body: JSON.stringify({ + emojiId: emojiId, + i: bAdmin.client.credential, + }), + headers: { + 'Content-Type': 'application/json', + }, + credentials: 'omit', + cache: 'no-cache', + }); + console.log(await res.json()); }); });