fix(test): silence expected oauth login cli output

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-04 17:17:01 +09:00
parent b3d69e71f0
commit fb7e3fd98d
+8 -2
View File
@@ -1,4 +1,4 @@
import { afterAll, describe, it, expect, beforeEach, afterEach, mock } from "bun:test"
import { afterAll, afterEach, beforeEach, describe, expect, it, mock, spyOn } from "bun:test"
const mockLogin = mock(() => Promise.resolve({ accessToken: "test-token", expiresAt: 1710000000 }))
@@ -18,12 +18,18 @@ afterAll(() => {
const { login } = await import("./login")
describe("login command", () => {
let consoleErrorSpy: ReturnType<typeof spyOn>
let consoleLogSpy: ReturnType<typeof spyOn>
beforeEach(() => {
mockLogin.mockClear()
consoleErrorSpy = spyOn(console, "error").mockImplementation(() => {})
consoleLogSpy = spyOn(console, "log").mockImplementation(() => {})
})
afterEach(() => {
// cleanup
consoleErrorSpy.mockRestore()
consoleLogSpy.mockRestore()
})
it("returns error code when server-url is not provided", async () => {