From 09716054f4c7077463cd673064f1b65ed7a63983 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Mon, 17 Aug 2026 23:31:12 +0200 Subject: [PATCH] fix(test): let the README link check stand down where there is no README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check I added for `?template=` links read README.md unconditionally, and the image build is the one place that runs this suite without it: `.dockerignore` omits the README along with docs/ and AGENTS.md, so that editing a doc does not invalidate the layer that installs, typechecks, tests and builds. `.github/` is copied in for the opposite reason, which is why every other check in the file ran there fine. So this failed in a way CI could not see — the check job has the whole repository and stayed green, while the container build went red on a file that context leaves out on purpose. Skipping it there keeps the gate honest about what it can actually inspect; the assertion still runs in CI and locally, which is where a README link is edited in the first place. Verified by running the suite inside the build stage: 516 pass, 1 skip, 0 fail, against 517 pass and no skips in the full tree. Co-Authored-By: Claude Opus 5 (1M context) --- test/issue-templates.test.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/issue-templates.test.tsx b/test/issue-templates.test.tsx index 065e715..43c45b6 100644 --- a/test/issue-templates.test.tsx +++ b/test/issue-templates.test.tsx @@ -21,6 +21,21 @@ import { const DIR = ".github/ISSUE_TEMPLATE"; +/** + * Whether the README is in this context at all. + * + * The image build runs this suite as its gate, and `.dockerignore` excludes the + * README along with `docs/` and `AGENTS.md` — deliberately, so that editing a + * doc does not invalidate the layer that installs, tests and builds. `.github/` + * is copied in for the opposite reason, which is why every other check here runs + * there unchanged. + * + * So the README check stands down where the file was left out on purpose, rather + * than failing the image on the absence of something that context does not ship. + * It still runs in CI and locally, which is where a README link gets edited. + */ +const HAS_README = await Bun.file("README.md").exists(); + type Field = { type: string; id?: string; @@ -122,7 +137,7 @@ describe("the app's links into them", () => { expect(params.get("refreshed")).toBe("15 Aug 2026, 04:12 — 2 days ago"); }); - test("every template link in the README names a template that exists", async () => { + test.skipIf(!HAS_README)("every template link in the README names a template that exists", async () => { // A `?template=` that names nothing lands the reader on the chooser instead, // which looks close enough to working that nobody reports it. const readme = await Bun.file("README.md").text();