fix: logo 右半部分从 CODING 改为 CODE
去掉难以正确渲染的 N 和 G 字母,右半部分简化为 CODE(4 字母), 与左半部分 AIR 组合为 AIR CODE。
This commit is contained in:
16
packages/opencode/test/util/error.test.ts
Normal file
16
packages/opencode/test/util/error.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { NamedError } from "@opencode-ai/core/util/error"
|
||||
import { MessageError } from "../../src/session/message-error"
|
||||
|
||||
describe("util.error", () => {
|
||||
test("schema-backed named errors are real NamedError instances", () => {
|
||||
const error = new MessageError.AuthError({ providerID: "anthropic", message: "boom" })
|
||||
|
||||
expect(error).toBeInstanceOf(NamedError)
|
||||
expect(error.toObject()).toEqual({ name: "ProviderAuthError", data: { providerID: "anthropic", message: "boom" } })
|
||||
})
|
||||
|
||||
test("named errors without fields serialize data", () => {
|
||||
expect(new MessageError.OutputLengthError({}).toObject()).toEqual({ name: "MessageOutputLengthError", data: {} })
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user