mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-17 21:30:08 +00:00
test(cli): cover config json diagnostics (#27257)
This commit is contained in:
parent
d3d7b44e73
commit
dd46fddf22
1 changed files with 11 additions and 0 deletions
|
|
@ -39,6 +39,17 @@ describe("cli.error", () => {
|
|||
}
|
||||
})
|
||||
|
||||
test("preserves multiline JSONC diagnostics for tagged config errors", () => {
|
||||
const data = {
|
||||
path: "/tmp/opencode.jsonc",
|
||||
message: '\n--- JSONC Input ---\n{\n "model": \n}\n--- Errors ---\nValueExpected at line 3, column 1\n Line 3: }\n ^\n--- End ---',
|
||||
}
|
||||
const expected = `Config file at ${data.path} is not valid JSON(C): ${data.message}`
|
||||
|
||||
expect(FormatError({ name: "ConfigJsonError", data })).toBe(expected)
|
||||
expect(FormatError({ _tag: "ConfigJsonError", ...data })).toBe(expected)
|
||||
})
|
||||
|
||||
test("formats account transport errors clearly", () => {
|
||||
const error = new AccountTransportError({
|
||||
method: "POST",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue