mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-06 08:49:51 +00:00
17 lines
681 B
TypeScript
17 lines
681 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { errorDescriptionKey } from "./error-description"
|
|
|
|
describe("error description", () => {
|
|
test("describes local server startup errors", () => {
|
|
expect(errorDescriptionKey(Object.assign(new Error("migration failed"), { localServerStartup: true }))).toBe(
|
|
"error.page.description.localServerStartup",
|
|
)
|
|
})
|
|
|
|
test("uses the generic description for other errors", () => {
|
|
expect(errorDescriptionKey(new Error("unknown"))).toBe("error.page.description")
|
|
expect(errorDescriptionKey(Object.assign(new Error("unknown"), { localServerStartup: false }))).toBe(
|
|
"error.page.description",
|
|
)
|
|
})
|
|
})
|