fix(tools): report uncovered functions in coverage:analyze, matching CI - #301
Merged
Conversation
analyze-coverage.mjs only walked the statement (`s`) and branch (`b`) maps, so
it was blind to a never-called function whose body carries no statements of its
own — e.g. an empty `() => {}` callback. v8's `f`/`fnMap` is the only signal for
that case, and CI's coverage-summary.json counts it, so the local report read
"all clear" while the badge showed <100% functions. Add a functions pass that
reports each uncovered function (name + declaration line + context), and update
the summary wording to cover statements, branches, and functions.
…ze catch
The empty `.catch(() => {})` at unified-wrapper.mjs:3417 (getTrap's background
materialization kick-off) was the one uncovered function repo-wide — its
statement runs, but no test made that background `_materialize()` reject, so
the callback never fired. It is reachable: construct a lazy wrapper whose
materializeFunc rejects, read a plain property to trigger the getTrap branch,
and assert the rejection is swallowed (no unhandledRejection leaks) rather than
surfacing — the exact contract that catch provides. Brings functions coverage
to 100% alongside the existing 100% statements/branches/lines.
Shinrai
force-pushed
the
fix/coverage-analyze-functions
branch
from
August 20, 2026 23:52
36ed4fc to
0dd03b7
Compare
Shinrai
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
No new features
🐛 Bug Fixes
📦 Dependencies
No dependency updates
🔧 Other Changes
👥 Contributors