feat: 增加模板自动一致性校验

This commit is contained in:
que01 committed 2026-10-16 14:12:46 +08:00
1 parent cddf836f4f
commit 553a07c4ec
4 files changed
+145 -2

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import path from "node:path";
import { fileURLToPath } from "node:url";
import test from "node:test";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const script = path.join(root, "scripts/template-conformance.cjs");
test("template:conformance automatically discovers all template packages", () => {
const output = execFileSync(process.execPath, [script], { cwd: root, encoding: "utf8" });
assert.match(output, /Conformance passed: acheng-campus-food@1\.0\.0/);
assert.match(output, /Conformance passed: atelier-solopreneur@1\.1\.0/);
assert.match(output, /Conformance passed: linjing-editorial@1\.0\.0/);
assert.match(output, /Template conformance passed: 3 package\(s\)\./);
});