Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[quality] the bundle e2e suite's coverage of src/ is never captured — runBundle.ts drops NODE_V8_COVERAGE and dist/ has no source map

クローズ
#235 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, typescript

調査の方向性

Start with tests/bundle/runBundle.ts and tests/bundle/bundle.test.ts, then inspect the package.json pack script and vitest.config.mjs coverage settings. Run the coverage command described in the issue to establish the current unit-only result. Done means the child coverage environment and source-map behavior are verified, with hits remapped to src/**/*.ts, or the unit-only limitation is documented if that is the chosen approach.

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

説明

agent/quality hive/hosted-available-lke648397-260827-5q9t hive/verified-open kind/cleanup quality testing

Finding

__tests__/bundle/bundle.test.ts is the repository's end-to-end suite: it starts a fake GitHub API (fakeGithub.ts) and runs the committed dist/index.js against it in a child process. It is the only place the shipped bundle is exercised, yet none of its coverage reaches the coverage report:

  • __tests__/bundle/runBundle.ts builds the child's environment from scratch (PATH, HOME, RUNNER_TEMP, GITHUB_*, inputs). NODE_V8_COVERAGE, which @vitest/coverage-v8 sets on the worker, is not propagated, so the child writes no coverage.
  • Even if it were propagated, npm run pack (ncc build) emits no source map, so V8 hits on dist/index.js could not be mapped back to src/**/*.ts.

Consequence: npx vitest run --coverage on main @ c48bd6d reports 99.83% lines / 98.35% branches, but that is unit-only evidence. Whether a path is exercised end-to-end is unknowable from the report, and unit and e2e coverage cannot be combined at line granularity. Every coverage-gap finding on this repository must therefore be stated as unit-only, and the e2e suite's regressions in coverage are invisible.

Recommendation

  • runBundle.ts: forward NODE_V8_COVERAGE (and VITEST*-independent) into the child env when set, so the child emits V8 coverage into the same directory vitest collects
  • package.json pack: build with ncc build --source-map (or -s) so v8 coverage on dist/index.js maps to src/; decide whether the map is committed alongside dist/index.js or built only for the coverage run
  • vitest.config.mjs coverage.include continues to be src/**/*.ts; confirm dist/index.js hits are remapped rather than reported as an untracked file

If the maintainers prefer not to change the pack step, the alternative is to record in vitest.config.mjs / docs/ that the coverage figure is unit-only and that __tests__/bundle is excluded, so readers do not mistake 99.8% for end-to-end coverage.

Priority

  • Impact: medium — the only e2e suite has no measurable coverage; unit and e2e evidence cannot be merged
  • Effort: medium

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 924fa8d

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

主要言語
TypeScript
スター
132
フォーク
24
平均マージ
1日 16時間
マージ済み PR(30日)
209

環境構築

はじめの一歩

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

cncf/prow-github-actions のほかの issue

cncf/prow-github-actions の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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