2026-02-13 17:29:38 +09:00
|
|
|
import { describe, it, expect } from "bun:test"
|
2025-12-30 15:06:41 +09:00
|
|
|
import * as deps from "./dependencies"
|
|
|
|
|
|
|
|
|
|
describe("dependencies check", () => {
|
|
|
|
|
describe("checkAstGrepCli", () => {
|
2026-02-13 17:29:38 +09:00
|
|
|
it("returns valid dependency info", async () => {
|
|
|
|
|
//#given ast-grep cli check
|
|
|
|
|
//#when checking
|
2025-12-30 15:06:41 +09:00
|
|
|
const info = await deps.checkAstGrepCli()
|
|
|
|
|
|
2026-02-13 17:29:38 +09:00
|
|
|
//#then should return valid DependencyInfo
|
2025-12-30 15:06:41 +09:00
|
|
|
expect(info.name).toBe("AST-Grep CLI")
|
|
|
|
|
expect(info.required).toBe(false)
|
|
|
|
|
expect(typeof info.installed).toBe("boolean")
|
2026-02-13 17:29:38 +09:00
|
|
|
expect(typeof info.version === "string" || info.version === null).toBe(true)
|
|
|
|
|
expect(typeof info.path === "string" || info.path === null).toBe(true)
|
2025-12-30 15:06:41 +09:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
describe("checkAstGrepNapi", () => {
|
2026-02-13 17:29:38 +09:00
|
|
|
it("returns valid dependency info", async () => {
|
|
|
|
|
//#given ast-grep napi check
|
|
|
|
|
//#when checking
|
2026-01-21 15:42:21 +09:00
|
|
|
const info = await deps.checkAstGrepNapi()
|
2025-12-30 15:06:41 +09:00
|
|
|
|
2026-02-13 17:29:38 +09:00
|
|
|
//#then should return valid DependencyInfo
|
2025-12-30 15:06:41 +09:00
|
|
|
expect(info.name).toBe("AST-Grep NAPI")
|
|
|
|
|
expect(info.required).toBe(false)
|
|
|
|
|
expect(typeof info.installed).toBe("boolean")
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
describe("checkCommentChecker", () => {
|
2026-02-13 17:29:38 +09:00
|
|
|
it("returns valid dependency info", async () => {
|
|
|
|
|
//#given comment checker check
|
|
|
|
|
//#when checking
|
2025-12-30 15:06:41 +09:00
|
|
|
const info = await deps.checkCommentChecker()
|
|
|
|
|
|
2026-02-13 17:29:38 +09:00
|
|
|
//#then should return valid DependencyInfo
|
2025-12-30 15:06:41 +09:00
|
|
|
expect(info.name).toBe("Comment Checker")
|
|
|
|
|
expect(info.required).toBe(false)
|
|
|
|
|
expect(typeof info.installed).toBe("boolean")
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|