fix: verify-references installs TS deps; sync-check covers expansion tests; template gitignore and passWithNoTests
verify-references ran a bare `npx vitest run` in the staged reference, which fetched an unrelated vitest that could not load the reference config. It now installs the reference's devDependencies first. sync-check also checks each module's expansion/tests against ### headings in expansion/README.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ffa99785c3
commit
1453a00b9c
14 files changed
+59
-18
No files matched your search
+15
-8
@@ -1,24 +1,31 @@
|
||||
#!/usr/bin/env node
|
||||
// Verifies Rust tests, TS tests and scenarios.md list identical test names per module.
|
||||
// A module's Expansion Drop (expansion/tests/{rust,ts}, scenarios as `### test_…`
|
||||
// headings in expansion/README.md) is checked the same way, as a separate set.
|
||||
import { join } from "node:path";
|
||||
import { moduleDirs, testNames, scenarioNames } from "./lib.mjs";
|
||||
|
||||
const problems = [];
|
||||
for (const mod of moduleDirs()) {
|
||||
function check(label, path, scenarioFile) {
|
||||
const sets = {
|
||||
rust: testNames(mod.path, "rust"),
|
||||
ts: testNames(mod.path, "ts"),
|
||||
scenarios: scenarioNames(mod.path),
|
||||
rust: testNames(path, "rust"),
|
||||
ts: testNames(path, "ts"),
|
||||
scenarios: scenarioNames(path, scenarioFile),
|
||||
};
|
||||
if (Object.values(sets).every((s) => s.length === 0)) continue;
|
||||
if (Object.values(sets).every((s) => s.length === 0)) return;
|
||||
const all = new Set(Object.values(sets).flat());
|
||||
for (const name of [...all].sort()) {
|
||||
for (const [where, names] of Object.entries(sets)) {
|
||||
if (!names.includes(name)) {
|
||||
problems.push(`module ${mod.num}-${mod.slug}: ${name} missing from ${where}`);
|
||||
}
|
||||
if (!names.includes(name)) problems.push(`${label}: ${name} missing from ${where}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const mod of moduleDirs()) {
|
||||
const label = `module ${mod.num}-${mod.slug}`;
|
||||
check(label, mod.path, "scenarios.md");
|
||||
check(`${label} expansion`, join(mod.path, "expansion"), "README.md");
|
||||
}
|
||||
if (problems.length) {
|
||||
console.error("sync-check: mismatches\n" + problems.map((p) => " " + p).join("\n"));
|
||||
process.exit(1);
|
||||
|
||||
Reference in new issue
Block a user