{"draft":null,"from":87,"to":318,"files":[{"path":"scripts/check-changed.test.ts","added":40,"removed":0,"diff":"--- /dev/null\n+++ b/scripts/check-changed.test.ts\n@@ -0,0 +1,40 @@\n+// check:changed's plan: what a change reaches, on this repo as it is.\n+\n+import assert from \"node:assert/strict\";\n+import { test } from \"node:test\";\n+// @ts-expect-error: a plain .mjs script, no types\n+import { plan } from \"./check-changed.mjs\";\n+\n+test(\"a changed source file brings in the test files that import it, through other files, and the typecheck\", () => {\n+\tconst p = plan([\"src/engine/text.ts\"]);\n+\tassert.equal(p.full, undefined);\n+\tconst files: string[] = p.tests[0].files;\n+\tassert.ok(files.length > 0);\n+\tassert.ok(files.every((f) => f.endsWith(\".test.ts\")));\n+\tassert.ok(!files.includes(\"scripts/check-changed.test.ts\"), \"a test that doesn't reach the file stays out\");\n+\tassert.deepEqual(\n+\t\tp.typechecks.map((c: { tsconfig: string }) => c.tsconfig),\n+\t\t[\"tsconfig.json\", \"server/tsconfig.json\"],\n+\t);\n+\tassert.deepEqual(p.lint, [\"src/engine/text.ts\"]);\n+});\n+\n+test(\"a changed test file runs itself\", () => {\n+\tconst p = plan([\"scripts/check-changed.test.ts\"]);\n+\tassert.deepEqual(\n+\t\tp.tests.map((t: { files: string[] }) => t.files),\n+\t\t[[\"scripts/check-changed.test.ts\"]],\n+\t);\n+\tassert.deepEqual(p.typechecks, [], \"tsconfig.json doesn't include scripts/\");\n+});\n+\n+test(\"a change to setup runs the full check\", () => {\n+\tassert.deepEqual(plan([\"src/engine/text.ts\", \"package.json\"]).full, [\"package.json\"]);\n+\tassert.deepEqual(plan([\"tsconfig.json\"]).full, [\"tsconfig.json\"]);\n+});\n+\n+test(\"server changes include their tests and worker types\", () => {\n+\tconst p = plan([\"server/src/engine-project.ts\"]);\n+\tassert.ok(p.tests.flatMap((t: { files: string[] }) => t.files).includes(\"server/test/engine-project.test.ts\"));\n+\tassert.ok(p.typechecks.some((c: { tsconfig: string }) => c.tsconfig === \"server/tsconfig.json\"));\n+});"}],"unmatched":[]}