2ba148be12
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.
46 lines
1.5 KiB
TypeScript
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")
|
|
})
|
|
})
|
|
})
|