From 48cf32c930924840d0892af92d71b9437acb5844 Mon Sep 17 00:00:00 2001 From: Kisaragi Marine Date: Fri, 21 Jun 2024 05:04:45 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BD=95=E6=95=85=E3=81=8B=E3=81=86=E3=81=BE?= =?UTF-8?q?=E3=81=8F=E8=A1=8C=E3=81=8B=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E3=80=81=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88=E3=81=9AXOR?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/test/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index a04a20c478..da0a54cf33 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -17,6 +17,7 @@ import { validateContentTypeSetAsActivityPub } from '@/core/activitypub/misc/val import { entities } from '../src/postgres.js'; import { loadConfig } from '../src/config.js'; import type * as misskey from 'misskey-js'; +import { ApiError } from "@/server/api/error.js"; export { server as startServer, jobQueue as startJobQueue } from '@/boot/common.js'; @@ -66,10 +67,13 @@ export const failedApiCall = async = { [P in Exclude]?: never }; +type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + export const api = async (path: E, params: misskey.Endpoints[E]['req'], me?: UserToken): Promise<{ status: number, headers: Headers, - body: misskey.Endpoints[E]['res'] + body: XOR }> => { const bodyAuth: Record = {}; const headers: Record = {