diff --git a/packages/backend/test/misc/mock-resolver.ts b/packages/backend/test/misc/mock-resolver.ts index f11097b986..d3302dc9bb 100644 --- a/packages/backend/test/misc/mock-resolver.ts +++ b/packages/backend/test/misc/mock-resolver.ts @@ -8,7 +8,7 @@ import type { ApDbResolverService } from '@/core/activitypub/ApDbResolverService import type { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import type { ApRequestService } from '@/core/activitypub/ApRequestService.js'; import { Resolver } from '@/core/activitypub/ApResolverService.js'; -import type { IObject } from '@/core/activitypub/type.js'; +import type { IObject, IObjectWithId } from '@/core/activitypub/type.js'; import type { HttpRequestService } from '@/core/HttpRequestService.js'; import type { InstanceActorService } from '@/core/InstanceActorService.js'; import type { LoggerService } from '@/core/LoggerService.js'; @@ -25,6 +25,7 @@ import type { } from '@/models/_.js'; import { ApLogService } from '@/core/ApLogService.js'; import { ApUtilityService } from '@/core/activitypub/ApUtilityService.js'; +import { fromTuple } from '@/misc/from-tuple.js'; type MockResponse = { type: string; @@ -72,8 +73,11 @@ export class MockResolver extends Resolver { return this.#remoteGetTrials; } + public async resolve(value: string | [string]): Promise; + public async resolve(value: string | IObject | [string | IObject]): Promise; @bindThis - public async resolve(value: string | IObject): Promise { + public async resolve(value: string | IObject | [string | IObject]): Promise { + value = fromTuple(value); if (typeof value !== 'string') return value; this.#remoteGetTrials.push(value); diff --git a/packages/backend/test/unit/activitypub.ts b/packages/backend/test/unit/activitypub.ts index 5767089109..456a476c16 100644 --- a/packages/backend/test/unit/activitypub.ts +++ b/packages/backend/test/unit/activitypub.ts @@ -2,6 +2,7 @@ * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ + process.env.NODE_ENV = 'test'; import * as assert from 'assert'; @@ -27,6 +28,7 @@ import { DI } from '@/di-symbols.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { DownloadService } from '@/core/DownloadService.js'; import { genAidx } from '@/misc/id/aidx.js'; +import { IdService } from '@/core/IdService.js'; import { MockResolver } from '../misc/mock-resolver.js'; import { UserKeypairService } from '@/core/UserKeypairService.js'; import { MemoryKVCache, RedisKVCache } from '@/misc/cache.js'; diff --git a/packages/shared/eslint.config.js b/packages/shared/eslint.config.js index be7a031b63..295829e374 100644 --- a/packages/shared/eslint.config.js +++ b/packages/shared/eslint.config.js @@ -41,6 +41,7 @@ export default [ '@typescript-eslint/prefer-nullish-coalescing': ['warn', { ignorePrimitives: true, }], + 'no-param-reassign': 'off', }, }, ];