Skip to content

test: expand coverage for sources, helpers, and package entry#200

Merged
alexander-akait merged 2 commits intomainfrom
claude/improve-test-coverage-om5RD
Apr 21, 2026
Merged

test: expand coverage for sources, helpers, and package entry#200
alexander-akait merged 2 commits intomainfrom
claude/improve-test-coverage-om5RD

Conversation

@alexander-akait
Copy link
Copy Markdown
Member

Add targeted tests that exercise previously untested branches and
edge cases: the abstract Source base class, SizeOnlySource's
updateHash, CompatSource's optional delegates, RawSource's
type validation and Buffer-backed source path, OriginalSource's
getName and Buffer-backed map path, ConcatSource's buffer()
fallbacks and re-optimization paths, PrefixSource's accessors and
empty-prefix handling, ReplaceSource's accessors, guards, hash
stability, and edge cases, CachedSource's lazy source accessor,
hash flushing, map-only streamChunks, and Buffer round-tripping,
and SourceMapSource's string/buffer source-map variants and hash
inclusion of removeOriginalSource. Add a dedicated helpers unit
test file covering getGeneratedSourceInfo, getSource,
splitIntoLines, splitIntoPotentialTokens, readMappings,
getFromStreamChunks, streamAndGetSourceAndMap, and
stringBufferUtils, including string-interning toggles and gap
filling for non-sequential source/name indices.

Add targeted tests that exercise previously untested branches and
edge cases: the abstract `Source` base class, `SizeOnlySource`'s
`updateHash`, `CompatSource`'s optional delegates, `RawSource`'s
type validation and Buffer-backed source path, `OriginalSource`'s
`getName` and Buffer-backed map path, `ConcatSource`'s `buffer()`
fallbacks and re-optimization paths, `PrefixSource`'s accessors and
empty-prefix handling, `ReplaceSource`'s accessors, guards, hash
stability, and edge cases, `CachedSource`'s lazy source accessor,
hash flushing, map-only streamChunks, and Buffer round-tripping,
and `SourceMapSource`'s string/buffer source-map variants and hash
inclusion of `removeOriginalSource`. Add a dedicated helpers unit
test file covering `getGeneratedSourceInfo`, `getSource`,
`splitIntoLines`, `splitIntoPotentialTokens`, `readMappings`,
`getFromStreamChunks`, `streamAndGetSourceAndMap`, and
`stringBufferUtils`, including string-interning toggles and gap
filling for non-sequential source/name indices.
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 21, 2026

CLA Not Signed

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 21, 2026

⚠️ No Changeset found

Latest commit: 5d3ddfb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.07%. Comparing base (5a07869) to head (5d3ddfb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   93.24%   98.07%   +4.82%     
==========================================
  Files          25       25              
  Lines        1866     1866              
  Branches      595      596       +1     
==========================================
+ Hits         1740     1830      +90     
+ Misses        117       34      -83     
+ Partials        9        2       -7     
Flag Coverage Δ
integration 98.07% <ø> (+4.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 21, 2026

Merging this PR will not alter performance

✅ 147 untouched benchmarks


Comparing claude/improve-test-coverage-om5RD (5d3ddfb) with main (5a07869)

Open in CodSpeed

Store the freshly constructed CachedSource instances into a pre-sized
sink array so V8 cannot dead-code-eliminate them and memory pressure
stays consistent between samples. Overwriting existing slots (rather
than push + length reset) keeps the sink's hidden class stable and
avoids resize allocations during measurement. This reduces run-to-run
variance that was surfacing as false codspeed regressions on this
task.
@alexander-akait alexander-akait merged commit 251bc10 into main Apr 21, 2026
30 of 31 checks passed
@alexander-akait alexander-akait deleted the claude/improve-test-coverage-om5RD branch April 21, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants