From 1623ac3ba94028cfdca972fb283ef8e7401c42a2 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 22:28:48 -0500 Subject: [PATCH] test(cli): update auth account coverage (#48066) Co-authored-by: rekram1-node --- packages/cli/test/auth.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/cli/test/auth.test.ts b/packages/cli/test/auth.test.ts index 793a82f0cd0..97f8ec74364 100644 --- a/packages/cli/test/auth.test.ts +++ b/packages/cli/test/auth.test.ts @@ -18,7 +18,8 @@ describe("auth command", () => { expect(auth.stdout).toContain("manage AI providers and credentials") expect(auth.stdout).toContain("list providers and credentials") expect(auth.stdout).toContain("log in to a provider") - expect(auth.stdout).toContain("log out from a configured provider") + expect(auth.stdout).toContain("log out of a saved account") + expect(auth.stdout).toContain("switch the active account for an integration") expect(auth.stdout).not.toContain("connect") expect(list.exitCode).toBe(0) expect(list.stdout).toContain("opencode auth list [flags]") @@ -28,7 +29,7 @@ describe("auth command", () => { expect(login.stdout).toContain("Integration ID, name, or well-known provider URL") expect(login.stdout).toContain("--method") expect(logout.exitCode).toBe(0) - expect(logout.stdout).toContain("opencode auth logout [flags] []") + expect(logout.stdout).toContain("opencode auth logout [flags] [] []") }) test("lists stored and environment connections", async () => { @@ -220,7 +221,7 @@ describe("auth command", () => { expect(result.stdout).not.toContain("\n at ") }) - test("removes stored credentials", async () => { + test("removes a selected stored credential", async () => { const removed: string[] = [] using server = authServer((request, url) => { if (url.pathname === "/api/integration") { @@ -242,9 +243,9 @@ describe("auth command", () => { return new Response("Not found", { status: 404 }) }) - const result = await cli(["auth", "logout", "anthropic", "--server", server.url.toString()]) + const result = await cli(["auth", "logout", "anthropic", "cred_test", "--server", server.url.toString()]) expect({ exitCode: result.exitCode, stderr: result.stderr }).toEqual({ exitCode: 0, stderr: "" }) - expect(result.stdout).toContain("Disconnected from Anthropic") + expect(result.stdout).toContain("Removed account from Anthropic") expect(removed).toEqual(["cred_test"]) })