Files
oh-my-opencode/src/cli/doctor/checks/config.test.ts
T
YeonGyu-Kim 2ba148be12 refactor(doctor): redesign with 3-tier output and consolidated checks
Consolidate 16 separate checks into 5 (system, config, providers, tools, models).
Add 3-tier formatting: default (problems-only), --status (dashboard), --verbose (deep diagnostics).
Read actual loaded plugin version from opencode cache directory.
Check environment variables for provider authentication.
2026-02-13 17:29:38 +09:00

28 lines
954 B
TypeScript

import { describe, it, expect } from "bun:test"
import * as config from "./config"
describe("config check", () => {
describe("checkConfig", () => {
it("returns a valid CheckResult", async () => {
//#given config check is available
//#when running the consolidated config check
const result = await config.checkConfig()
//#then should return a properly shaped CheckResult
expect(result.name).toBe("Configuration")
expect(["pass", "fail", "warn", "skip"]).toContain(result.status)
expect(typeof result.message).toBe("string")
expect(Array.isArray(result.issues)).toBe(true)
})
it("includes issues array even when config is valid", async () => {
//#given a normal environment
//#when running config check
const result = await config.checkConfig()
//#then issues should be an array (possibly empty)
expect(Array.isArray(result.issues)).toBe(true)
})
})
})