Untested reject branches in search, safe-fetch and schema-check, and no guide-page test

オープン 初心者向け
#266 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, node.js
領域
backend, testing

調査の方向性

まず site/lib/lib.test.mjs と、site/lib/search.mjs、safe-fetch.mjs、schema-check.mjs、guide-page.mjs、guide-render.mjs にある指定の関数を確認します。npm test を実行して既存のカバレッジを確認し、次に列挙された拒否、同点時の優先順位、レンダリング、テキスト変換のケースに対するアサーションを追加します。これらのアサーションが成功し、各受け入れ基準を保護できたら完了です。

索引モデルが issue の本文から書いたものです。

説明

good first issue priority: low tests

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-178
  • site/lib/safe-fetch.mjs:66-67, :99-101
  • site/lib/schema-check.mjs:30, :34, :47-49
  • site/lib/guide-page.mjs:10-57
  • site/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

  • passesFilters rejects a perspective mismatch and a licence-family mismatch
  • SORTS.license and SORTS.verified break ties by name
  • isPrivateAddress: 198.18.0.1, 198.19.255.255, 198.51.100.7, ::ffff:198.18.0.1 true; 198.20.0.1 false
  • refusalFor("not a url") returns "not a valid URL"
  • schemaErrors with $ref: "http://x" or a missing #/defs/y throws naming the ref
  • Guide page: <&"> in the title is escaped in <title>, breadcrumb and h1; modified: null omits dateModified; long first paragraph clipped to 160 chars in the description; no titleId gives an h1 with no id; edit link is ${repo}/blob/main/${path}
  • plainText strips tags and decodes entities

Getting started

  • Relevant files: site/lib/lib.test.mjs
  • Run the tests: npm test; the full local gate is npm 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時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Free-Game-Dev-Assets のほかの issue

TMHSDigital/Free-Game-Dev-Assets の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。