ESLint 升级到 recommended-type-checked + stylistic-type-checked, 引入 perfectionist 导入排序和 import 插件导入验证。 Prettier 显式声明全部格式化参数,消除跨环境差异。 TypeScript 启用 noUnusedLocals 和 noPropertyAccessFromIndexSignature。 完善 ignore 列表,排除 .agents/、bun.lock、data/ 等。 引入 husky + lint-staged(pre-commit)+ commitlint(commit-msg)。 更新 DEVELOPMENT.md 代码质量章节。 修复所有新增规则检测到的类型和风格违规。
14 lines
435 B
TypeScript
14 lines
435 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
|
|
import { readRuntimeConfig } from "../../src/server/config";
|
|
|
|
describe("runtime config", () => {
|
|
test("返回配置文件路径", () => {
|
|
expect(readRuntimeConfig(["./probes.yaml"])).toEqual({ configPath: "./probes.yaml" });
|
|
});
|
|
|
|
test("未提供参数抛出错误", () => {
|
|
expect(() => readRuntimeConfig([])).toThrow("需要指定 YAML 配置文件路径");
|
|
});
|
|
});
|