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 config from "./config"
|
|
|
|
|
|
|
|
|
|
describe("config check", () => {
|
2026-02-13 17:29:38 +09:00
|
|
|
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)
|
2025-12-30 15:06:41 +09:00
|
|
|
})
|
|
|
|
|
|
2026-02-13 17:29:38 +09:00
|
|
|
it("includes issues array even when config is valid", async () => {
|
|
|
|
|
//#given a normal environment
|
|
|
|
|
//#when running config check
|
|
|
|
|
const result = await config.checkConfig()
|
2025-12-30 15:06:41 +09:00
|
|
|
|
2026-02-13 17:29:38 +09:00
|
|
|
//#then issues should be an array (possibly empty)
|
|
|
|
|
expect(Array.isArray(result.issues)).toBe(true)
|
2025-12-30 15:06:41 +09:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|