···33import { LIMITS } from "../../src/lib/limits.ts";
44import { BlobFetchError, fetchVerifiedBlob } from "../../src/lib/pds-fetch.ts";
5566-// resolveEndpoint and fetchFn are passed as DI, not module-mocked, to avoid
77-// conflicting with other test files that mock @atproto/identity.
66+// resolveEndpoint and fetchFn are passed as DI, not module-mocked, to keep
77+// this file independent of how identity.ts is mocked elsewhere.
88const mockResolvePdsEndpoint = mock(
99 async (_did: string): Promise<string | null> => null,
1010);
+7-6
tests/lib/profile.test.ts
···11import { describe, expect, mock, test } from "bun:test";
2233-// Mock the IdResolver before importing the module
33+// Mock identity.ts directly so we don't fight with @atcute/identity-resolver's
44+// constructor surface. pds-fetch.test.ts uses dependency injection instead, so
55+// the two mocking approaches don't conflict.
46const mockResolveHandle = mock(async () => "did:plc:resolved");
57const mockResolveDid = mock(async () => ({
68 alsoKnownAs: ["at://alice.bsky.social"],
79}));
81099-mock.module("@atproto/identity", () => ({
1010- IdResolver: class {
1111- handle = { resolve: mockResolveHandle };
1212- did = { resolve: mockResolveDid };
1313- },
1111+mock.module("../../src/lib/identity.ts", () => ({
1212+ getHandleResolver: () => ({ resolve: mockResolveHandle }),
1313+ getDidDocumentResolver: () => ({ resolve: mockResolveDid }),
1414+ resolvePdsEndpoint: async () => null,
1415}));
15161617const { resolveHandleToDid, resolveProfile, resolveProfiles } = await import(