You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 623388a
Browse filesBrowse the repository at this point in the historyBrowse files
tests: each block runs as a named section; a throw no longer ends the run (#203)
Both test files gain section(name, fn): the 68 self-contained blocks run
through it, a section that throws is reported as a failure and the run
continues, and TEST_ONLY=<words> runs only the matching sections. Counts
were already real (checks.test counts the checks it sees); lib.test now
also reports how many sections ran. Assertion totals are unchanged.
Not a migration to node:test: the files share top-level fixtures across
1,800 assertions, and sections give the isolation and selection without
rewriting them.
Closes#203
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LpkeXQPaUhxjgqdqnk6BrJ
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ To add a starter stack (one pick per need for a kind of game), follow [`stacks/R
73
73
Every pull request, every push to `main` (before the site deploys) and every release run one sequence, `npm run check` in [`package.json`](package.json). Pull requests and pushes run it on Node 24, again on Node 22, and on Windows; releases run it on Node 24:
74
74
75
75
1.`npm run lint` (`site/lint.mjs`): every script parses, and none imports a name it does not use. It is syntax-only, not ESLint: a misspelled variable still passes and fails only when that line runs, so code the tests never reach needs a test or a careful read.
76
-
2.`npm test`: the checks against known-bad fixtures (`site/checks.test.mjs`) and the site modules' tests (`site/lib/lib.test.mjs`).
76
+
2.`npm test`: the checks against known-bad fixtures (`site/checks.test.mjs`) and the site modules' tests (`site/lib/lib.test.mjs`). Each block runs as a named section: one that throws is reported as a failure and the rest still run, and `TEST_ONLY=<words> npm test` runs only the sections whose name contains those words.
77
77
3.`npm run validate` (`site/validate.mjs`): every entry, link, count table and file against the checks.
78
78
4.`npm run check-added` (`site/check-added.mjs`): no entry's `added` date is later than the file's first commit, following renames. It needs the full git history; CI fetches it, and a shallow clone of your own will fail this step.
79
79
5.`npm run build` (`site/build.mjs`): renders every page and runs the page checks.
rejects("V22 rejects an unknown maintenance value",checkMaintenance("bad.md",{maintenance: "dead"}),'maintenance "dead" is not one of archived | inactive');
rejects("thumbs manifest: rejects a thumbnail whose entry is no longer eligible",checkThumbManifest(manifest,newMap([["a",{ ...okEntry,license: "custom"}]]),["a.webp"]),'thumbnail for "a" must be removed: licence custom is not in the preview allowlist (run node site/thumbs.mjs)');
828
845
accepts("thumbs manifest: licence drift between two allowed licences is not an error",checkThumbManifest(manifest,newMap([["a",{ ...okEntry,license: "MIT"}]]),["a.webp"]));
829
846
rejects("thumbs manifest: stray file",checkThumbManifest(manifest,newMap([["a",okEntry]]),["a.webp","notes.txt"]),"site/public/thumbs/notes.txt is not a <id>.webp thumbnail");
@@ -858,7 +875,7 @@ accepts("V31 accepts a quoted restriction", checkNonCommercialEvidence("ok.md",
858
875
rejects("V31 rejects an unquoted restriction",checkNonCommercialEvidence("bad.md",{status: "active",commercial: false},"## Evidence\n\n- Live page (2026-01-01): \"free download\"\n"),"bad.md is active with commercial: false but no Evidence line mentions the commercial restriction");
@@ -913,7 +930,7 @@ rejects("V31 rejects an unquoted restriction", checkNonCommercialEvidence("bad.m
913
930
accepts("V11 ignores links right of the Licence column",checkComparisonLicences("3d",["| Take | Licence | Notes |","| --- | --- | --- |","| [a](ambientcg.md) | CC0 | see [st](sharetextures.md) |"].join("\n"),metas));
914
931
accepts("V11 ignores tables without a Licence column",checkComparisonLicences("3d",["| Take | Notes |","| --- | --- |","| [st](sharetextures.md) | CC0 |"].join("\n"),metas));
915
932
accepts("V11 leaves the ID listing to checkCategoryReadmeRows",checkComparisonLicences("3d",["| ID | Licence |","| --- | --- |","| [st](sharetextures.md) | CC0 |"].join("\n"),metas));
916
-
}
933
+
});
917
934
918
935
/* V34: preview allowlist agrees with the vocabulary ------------------------ */
919
936
accepts("V34 the real allowlist matches the real vocabulary",checkPreviewVocabulary(vocab));
@@ -922,15 +939,15 @@ rejects("V34 rejects a required licence the caption would not credit", checkPrev
922
939
rejects("V34 rejects a credit on a licence that does not ask for one",checkPreviewVocabulary({licenses: {MIT: {attribution: "notice"}}},["MIT"],()=>true),"carry a credit the licence does not ask for");
923
940
924
941
/* V38: a waived credit on a BY licence is quoted --------------------------- */
925
-
{
942
+
awaitsection("V38: a waived credit on a BY licence is quoted",async()=>{
accepts("V38 accepts a dated waiver quote",checkAttributionWaiver("ok.md",meta,"## Evidence\n\n- Page (2026-11-03): \"You do NOT have to credit me.\"\n",v));
accepts("V38 ignores a licence that does not require credit",checkAttributionWaiver("ok.md",{license: "MIT",attribution_required: false},"",v));
931
948
rejects("V38 rejects a waiver stated only in Notes",checkAttributionWaiver("bad.md",meta,"## Notes\n\n- Attribution waived\n\n## Evidence\n\n- Page (2026-08-24): \"CC BY 4.0\"\n",v),"quote the rights holder's waiver");
932
949
rejects("V38 rejects an undated waiver line",checkAttributionWaiver("bad.md",meta,"## Evidence\n\n- Page: \"credit is optional\"\n",v),"quote the rights holder's waiver");
933
-
}
950
+
});
934
951
935
952
/* V37: AI-generated content stays tagged and listed ------------------------ */
936
953
accepts("V37 accepts a tagged entry",checkAiTag("ok.md",{tags: ["ai-generated"]},"Some sounds are AI-generated."));
rejects("V32 a longer value does not count for its prefix",checkLicenceGuide({licenses: {"CC-BY": {}}},"| **CC-BY-4.0** | yes |"),'does not mention the licence value "CC-BY"');
975
992
976
993
/* validate's file-level checks, moved here to be tested (#224) ----------- */
977
-
{
994
+
awaitsection("validate's file-level checks, moved here to be tested (#224)",async()=>{
0 commit comments