Test harness stops at the first thrown error and prints a stale check count

未關閉
#203 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
重構
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
javascript, nodejs
領域
testing-qa

研究方向

The harness is hand-rolled eq/has/throws helpers in site/checks.test.mjs (around lines 52-75 and the summary near 817-822) and site/lib/lib.test.mjs (lines 16-38 and the summary near 1156-1162). Read those helpers and run npm test to see how one thrown exception stops the run. Done means a thrown error in one section no longer hides later results, the printed check count matches the real number of sections, and a single test can be selected by name, ideally via node:test's --test-name-pattern while keeping npm test as the entry point.

由索引模型根據 Issue 內容生成。

描述

help wanted priority: low tests

Summary

Both test files hand-roll eq/has/throws. An exception inside any section (as opposed to a failed eq) kills the process before the failure report prints, hiding every later assertion.

Where

  • site/checks.test.mjs:52-75, 817-822
  • site/lib/lib.test.mjs:16-38, 1156-1162

Details

checks.test.mjs prints a hard-coded "across 30 checks" while the file has 26 V-sections. lib.test.mjs is 1,163 lines in one scope and is the most-changed file in the repo.

Impact

One crash masks all other failures; no way to run a single test.

Suggested fix

Migrate section by section to the built-in node:test + node:assert (ships with Node 22, no dependency): per-test isolation, --test-name-pattern, real counts. Keep npm test as the entry point.

Acceptance criteria

  • A thrown error in one test does not hide the others
  • npm test reports real counts
  • A single test can be run by name

Getting started

  • Relevant files: site/checks.test.mjs, site/lib/lib.test.mjs, package.json
  • How to run tests: npm test (unit tests), npm run check (tests + validate + build). Node 22+, no dependencies.
  • Related docs: site/README.md, CONTRIBUTING.md

Filed by repo-audit/full-audit at 982fcd9. Severity: low. Effort: M. audit-key: testing|site/lib/lib.test.mjs|harness

主要語言
JavaScript
星號
58
分支
15
平均合併
1 天 14 小時
30 天內合併 PR
11

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Free-Game-Dev-Assets 的其他 Issue

查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。