Repository navigation
test: pin parentOf's empty-prefix fallback in the overlay machinery - #1078
Merged
Merged
Conversation
parentOf() rejects an overlay path the real data does not have with
`${label}: "${walked.join('.') || dottedPath}" is not an object ...`
and the `|| dottedPath` arm was the file's only uncovered region:
npm run test:unit:coverage reported tests/tools/e2e-data-fixtures.cjs at
100.00% lines but 98.59% regions, uncovered at line 130.
The existing non-object-parent test walks one segment before the array
stops it, so it only ever reaches the `walked.join('.')` arm. The
fallback is what the message uses when the *first* segment fails and
there is no prefix to name; without it the overlay is rejected with
"" is not an object in the real data, which identifies no path.
It is reachable rather than defensive: applyOverlay validates the
overlay document but never the real data, so a data file parsed as a
top-level array lands here on its first segment.
Adds one case driving an array, null and two non-object primitives --
each disjunct of the guard -- and asserting the message names the whole
dotted path. tests/tools/e2e-data-fixtures.cjs is now 100.00% regions.
No source change: the fallback was correct, only unpinned.
Closes #1077
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
This was referenced Oct 5, 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.
Test Improvement
Pins the
|| dottedPathfallback inparentOf()(
tests/tools/e2e-data-fixtures.cjs:130) — the only uncovered region in thatfile.
parentOf()rejects an overlay naming a path the real data does not have:`${label}: "${walked.join('.') || dottedPath}" is not an object in the real data`tests/e2e-data-fixtures.test.mjs:78reaches thewalked.join('.')arm only.Its case,
applyOverlay({ a: [1] }, { set: { 'a.b.c': 1 } }), walks onesegment before the array stops it, so
walkedis['a']. Nothing reached thefallback, which is the arm taken when the first segment fails and there is
no prefix to name — without it the overlay is rejected with
"" is not an object in the real data, naming nothing a reader can act on.It is reachable rather than defensive:
applyOverlay()validates that theoverlay is a JSON object (
e2e-data-fixtures.cjs:158) but never validatesthe real data, and
overlaySource()passes whateverJSON.parsereturned forthe data file. A data file regenerated as a top-level array lands here on its
first segment.
What this adds
One case, beside the existing non-object-parent test, driving
[],null,'text'and7— each disjunct of the guard, all of which fail on the firstsegment — and asserting the message names the whole dotted path.
No change to
tests/tools/e2e-data-fixtures.cjs. The fallback is correct; itwas simply unpinned.
Evidence
main900592b:npm run test:unit:coverage(
TZ=UTC node tests/tools/coverage-report.mjs, node v26.10.0) reportstests/tools/e2e-data-fixtures.cjs100.00% lines / 98.59% regions,uncovered region at line 130.
src filesis unchanged at100.00% / 99.84%, since no
src/**file is touched.npm run test:unit:coverage:checkexits 0.npx prettier --checkandnpx eslintboth clean on the changed file.${walked.join('.') || dottedPath}with${walked.join('.')}leaves all 22 pre-existing tests in the file passingand fails only the new one
(
actual: Error: f: "" is not an object in the real data). That is theevidence the case pins the region rather than merely passing beside it.
End-to-end coverage is not applicable and is not claimed either way: this
module runs inside the webpack build, not the browser, so it carries no
source-mapped regions in the
End-to-end coveragereport.Coordination
Touches exactly one file,
tests/e2e-data-fixtures.test.mjs, and one functionunder test,
parentOf(). Disjoint from every open hold-gated PR: the e2ereporter cluster (#1040, #1051, #1070, #1072), the coverage CLI (#1048), the
svg/mdx/asset scanners (#1039, #1042, #1044, #1056, #1063, #1068) and thee2e specs (#1054, #1058, #1060, #1065, #1075). #1034 is the only open PR that
edits this same file; its diff is confined to the
the variant build clears the fields the ordinary build keepstest and doesnot touch
parentOfor any of its error messages, so the two do not overlaptextually.
Branch cut from a fresh
origin/mainat900592b.Related Issue
Closes #1077
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88