Files
oh-my-opencode/src/cli/doctor/checks/dependencies.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

46 lines
1.5 KiB
TypeScript

import { describe, it, expect } from "bun:test"
import * as deps from "./dependencies"
describe("dependencies check", () => {
describe("checkAstGrepCli", () => {
it("returns valid dependency info", async () => {
//#given ast-grep cli check
//#when checking
const info = await deps.checkAstGrepCli()
//#then should return valid DependencyInfo
expect(info.name).toBe("AST-Grep CLI")
expect(info.required).toBe(false)
expect(typeof info.installed).toBe("boolean")
expect(typeof info.version === "string" || info.version === null).toBe(true)
expect(typeof info.path === "string" || info.path === null).toBe(true)
})
})
describe("checkAstGrepNapi", () => {
it("returns valid dependency info", async () => {
//#given ast-grep napi check
//#when checking
const info = await deps.checkAstGrepNapi()
//#then should return valid DependencyInfo
expect(info.name).toBe("AST-Grep NAPI")
expect(info.required).toBe(false)
expect(typeof info.installed).toBe("boolean")
})
})
describe("checkCommentChecker", () => {
it("returns valid dependency info", async () => {
//#given comment checker check
//#when checking
const info = await deps.checkCommentChecker()
//#then should return valid DependencyInfo
expect(info.name).toBe("Comment Checker")
expect(info.required).toBe(false)
expect(typeof info.installed).toBe("boolean")
})
})
})