Untested reject branches in search, safe-fetch and schema-check, and no guide-page test
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 83/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, node.js
研究方向
從 site/lib/lib.test.mjs 和 site/lib/search.mjs、safe-fetch.mjs、schema-check.mjs、guide-page.mjs、guide-render.mjs 中提到的函式開始。執行 npm test 查看現有涵蓋範圍,接著為列出的拒絕、平手判定、算繪和文字轉換案例新增斷言。這些斷言通過並保護每項驗收標準後,即為完成。
由索引模型根據 Issue 內容生成。
描述
Summary
V8 block coverage shows a handful of reject and tie-break branches in otherwise well-tested modules never run, and the guide page renderer has no unit test at all.
Where
site/lib/search.mjs:100-101,:169-178site/lib/safe-fetch.mjs:66-67,:99-101site/lib/schema-check.mjs:30,:34,:47-49site/lib/guide-page.mjs:10-57site/lib/guide-render.mjs:209(plainText)
Details
The behaviour was checked by hand and is correct today; only the regression guards are missing.
Impact
A future edit could silently break these branches.
Suggested fix
Add the assertions below to site/lib/lib.test.mjs.
Acceptance criteria
-
passesFiltersrejects a perspective mismatch and a licence-family mismatch -
SORTS.licenseandSORTS.verifiedbreak ties by name -
isPrivateAddress:198.18.0.1,198.19.255.255,198.51.100.7,::ffff:198.18.0.1true;198.20.0.1false -
refusalFor("not a url")returns "not a valid URL" -
schemaErrorswith$ref: "http://x"or a missing#/defs/ythrows naming the ref - Guide page:
<&">in the title is escaped in<title>, breadcrumb and h1;modified: nullomitsdateModified; long first paragraph clipped to 160 chars in the description; notitleIdgives an h1 with no id; edit link is${repo}/blob/main/${path} -
plainTextstrips tags and decodes entities
Getting started
- Relevant files:
site/lib/lib.test.mjs - Run the tests:
npm test; the full local gate isnpm run check(Node 22+, no install step) - Related docs:
CONTRIBUTING.md,site/README.md
Filed by repo-audit/full-audit at 4adb944. Severity: low. Effort: S. audit-key: testing|site/lib/search.mjs|reject-branches
- 主要語言
- JavaScript
- 星號
- 58
- 分支
- 15
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 12
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TMHSDigital/Free-Game-Dev-Assets 的其他 Issue
-
enhancement good first issue priority: medium
難度 2/5 1-3 小時 新手友好度 82/100
TMHSDigital/Free-Game-Dev-Assets#272 ·
維護者通常 1 天內回覆
-
documentation good first issue priority: low
難度 2/5 1-3 小時 新手友好度 78/100
TMHSDigital/Free-Game-Dev-Assets#270 ·
維護者通常 1 天內回覆
-
documentation priority: medium
難度 2/5 1-3 小時 新手友好度 82/100
TMHSDigital/Free-Game-Dev-Assets#269 ·
維護者通常 1 天內回覆
-
good first issue priority: low tests
難度 2/5 1-3 小時 新手友好度 88/100
TMHSDigital/Free-Game-Dev-Assets#267 ·
維護者通常 1 天內回覆
-
priority: low tests
難度 2/5 1-3 小時 新手友好度 82/100
TMHSDigital/Free-Game-Dev-Assets#265 ·
維護者通常 1 天內回覆
查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
microsoft/TypeScript#65370 ·
維護者通常 1 天內回覆
-
metrics priority: medium
難度 1/5 1-3 小時 新手友好度 86/100
LearningCircuit/local-deep-research#8336 ·
維護者通常 1 天內回覆
-
ace bug yaml
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
svelte: whitespace-only edit leaves an empty todo, edits not trimmed, filter not restored on reload未關閉
難度 2/5 1-3 小時 新手友好度 72/100
-
agentic-workflows
難度 1/5 1 小時以內 新手友好度 85/100
githubnext/gh-cao#20316 ·
維護者通常 1 天內回覆