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
@@ -0,0 +1 @@
|
||||
# Expansion
|
||||
@@ -0,0 +1,2 @@
|
||||
#[test]
|
||||
fn test_01x_c() {}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Expansion
|
||||
|
||||
### test_01x_a
|
||||
@@ -0,0 +1,2 @@
|
||||
#[test]
|
||||
fn test_01x_a() {}
|
||||
@@ -0,0 +1,2 @@
|
||||
import { test } from "vitest";
|
||||
test("test_01x_a", () => {});
|
||||
@@ -14,3 +14,9 @@ test("sync_passes_consistent_course", () => {
|
||||
const r = run("sync-check.mjs", [], { COURSE_ROOT: join(fixtures, "course") });
|
||||
assert.equal(r.code, 0, r.out);
|
||||
});
|
||||
|
||||
test("sync_checks_expansion_tests_against_readme", () => {
|
||||
const r = run("sync-check.mjs", [], { COURSE_ROOT: join(fixtures, "course-bad") });
|
||||
assert.match(r.out, /01-a expansion: test_01x_c missing from ts/);
|
||||
assert.match(r.out, /01-a expansion: test_01x_c missing from scenarios/);
|
||||
});
|
||||
@@ -45,3 +45,13 @@ test("verify_stage_copies_all_earlier_module_tests", async () => {
|
||||
for (const f of ["m01.rs", "m02.rs", "m03.rs"]) assert.ok(existsSync(join(dir, "tests", f)));
|
||||
assert.ok(existsSync(join(dir, "Cargo.toml")));
|
||||
});
|
||||
|
||||
test("verify_ts_default_installs_dependencies_first", async () => {
|
||||
// A staged reference has no node_modules; a bare `npx vitest` fetches the
|
||||
// latest vitest, which cannot load the reference's vitest.config.ts.
|
||||
const { commandFor } = await import("../verify-references.mjs");
|
||||
const cmd = commandFor("ts", {});
|
||||
assert.match(cmd, /^npm (ci|install)\b.*&& npx vitest run$/);
|
||||
assert.equal(commandFor("ts", { VERIFY_CMD_TS: "true" }), "true");
|
||||
assert.equal(commandFor("rust", {}), "cargo test");
|
||||
});
|
||||
Reference in new issue
Block a user