diff --git a/extensions/browser/src/cli/browser-cli-state.option-collisions.test.ts b/extensions/browser/src/cli/browser-cli-state.option-collisions.test.ts index 07d24325814..78d9f93431a 100644 --- a/extensions/browser/src/cli/browser-cli-state.option-collisions.test.ts +++ b/extensions/browser/src/cli/browser-cli-state.option-collisions.test.ts @@ -38,7 +38,8 @@ vi.spyOn(cliCoreApiModule.defaultRuntime, "exit").mockImplementation(browserCliR const { registerBrowserStateCommands } = await import("./browser-cli-state.js"); describe("browser state option collisions", () => { - const stripAnsi = (value: string) => value.replace(/\u001b\[[0-9;]*m/g, ""); + const ansiPattern = new RegExp(String.raw`\u001b\[[0-9;]*m`, "g"); + const stripAnsi = (value: string) => value.replace(ansiPattern, ""); const createStateProgram = ({ withGatewayUrl = false } = {}) => { const { program, browser, parentOpts } = createBrowserProgramShared({ withGatewayUrl }); diff --git a/src/channels/plugins/bundled.shape-guard.test.ts b/src/channels/plugins/bundled.shape-guard.test.ts index f12b56f985c..884e7b197f9 100644 --- a/src/channels/plugins/bundled.shape-guard.test.ts +++ b/src/channels/plugins/bundled.shape-guard.test.ts @@ -222,13 +222,11 @@ describe("bundled channel entry shape guards", () => { ); const plugin = bundled.requireBundledChannelPlugin("alpha"); - expect(plugin.meta).toMatchObject({ - id: "alpha", - label: "Alpha", - selectionLabel: "Use Alpha", - docsPath: "/channels/alpha", - blurb: "Alpha channel metadata.", - }); + expect(plugin.meta.id).toBe("alpha"); + expect(plugin.meta.label).toBe("Alpha"); + expect(plugin.meta.selectionLabel).toBe("Use Alpha"); + expect(plugin.meta.docsPath).toBe("/channels/alpha"); + expect(plugin.meta.blurb).toBe("Alpha channel metadata."); } finally { restoreBundledPluginsDir(previousBundledPluginsDir); fs.rmSync(tempRoot, { recursive: true, force: true }); diff --git a/src/channels/plugins/contracts/registry.contract.test.ts b/src/channels/plugins/contracts/registry.contract.test.ts index 5acd8e1afee..8bbb37a70c2 100644 --- a/src/channels/plugins/contracts/registry.contract.test.ts +++ b/src/channels/plugins/contracts/registry.contract.test.ts @@ -5,9 +5,10 @@ const discordSessionBindingAdapterChannels = ["discord"] as const; describe("channel contract registry", () => { function expectSessionBindingCoverage(expectedChannelIds: readonly string[]) { - expect([...sessionBindingContractChannelIds]).toEqual( - expect.arrayContaining([...expectedChannelIds]), - ); + const registeredIds = new Set(sessionBindingContractChannelIds); + for (const expectedChannelId of expectedChannelIds) { + expect(registeredIds.has(expectedChannelId)).toBe(true); + } } it.each([ diff --git a/src/channels/plugins/session-conversation.bundled-fallback.test.ts b/src/channels/plugins/session-conversation.bundled-fallback.test.ts index 0bad3e1d86b..b79f467547c 100644 --- a/src/channels/plugins/session-conversation.bundled-fallback.test.ts +++ b/src/channels/plugins/session-conversation.bundled-fallback.test.ts @@ -141,20 +141,15 @@ describe("session conversation bundled fallback", () => { it("delegates repeated fallback calls through the public-surface loader", () => { enableThreadedFallback(); - expect(resolveSessionConversationRef("agent:main:mock-threaded:group:room:topic:42")).toEqual( - expect.objectContaining({ - channel: "mock-threaded", - id: "room", - threadId: "42", - }), - ); - expect(resolveSessionConversationRef("agent:main:mock-threaded:group:room:topic:43")).toEqual( - expect.objectContaining({ - channel: "mock-threaded", - id: "room", - threadId: "43", - }), - ); + const firstRef = resolveSessionConversationRef("agent:main:mock-threaded:group:room:topic:42"); + expect(firstRef?.channel).toBe("mock-threaded"); + expect(firstRef?.id).toBe("room"); + expect(firstRef?.threadId).toBe("42"); + + const secondRef = resolveSessionConversationRef("agent:main:mock-threaded:group:room:topic:43"); + expect(secondRef?.channel).toBe("mock-threaded"); + expect(secondRef?.id).toBe("room"); + expect(secondRef?.threadId).toBe("43"); expect(fallbackState.loadCalls).toBe(2); }); }); diff --git a/src/channels/plugins/setup-wizard-helpers.test.ts b/src/channels/plugins/setup-wizard-helpers.test.ts index 215b313a0c1..419376a1b03 100644 --- a/src/channels/plugins/setup-wizard-helpers.test.ts +++ b/src/channels/plugins/setup-wizard-helpers.test.ts @@ -2118,12 +2118,14 @@ describe("resolveAccountIdForConfigure", () => { }); expect(accountId).toBe("prompted-id"); - expect(prompter.select).toHaveBeenCalledWith( - expect.objectContaining({ - message: "Signal account", - initialValue: "fallback", - }), - ); + const selectCalls = prompter.select.mock.calls as unknown as Array< + [{ message?: string; initialValue?: string }] + >; + const selectOptions = selectCalls[0]?.[0] as + | { message?: string; initialValue?: string } + | undefined; + expect(selectOptions?.message).toBe("Signal account"); + expect(selectOptions?.initialValue).toBe("fallback"); expect(prompter.text).not.toHaveBeenCalled(); }); });