test: cover the non-object property-declaration paths in rootUnion
The previous commit's coverage gate failed on `core/json/rootUnion.ts` branches (89.81%). A property declared with JSON Schema's boolean form has no keywords to merge, so the two sides agree only by being the same declaration — now tested both ways, and the dead `baseProperty !== undefined` guard is gone (`conflicts` is only reached for a name the base declares). Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
1a271e4931
commit
d8e9e502be
1 changed files with 32 additions and 3 deletions
|
|
@ -183,9 +183,11 @@ function conflicts(baseProperty: unknown, branchProperty: unknown): boolean {
|
|||
const a = toBranch(baseProperty);
|
||||
const b = toBranch(branchProperty);
|
||||
if (a === null || b === null) {
|
||||
return (
|
||||
baseProperty !== undefined && !sameValue(baseProperty, branchProperty)
|
||||
);
|
||||
// At least one side is not a readable schema object — JSON Schema's boolean
|
||||
// form, or something malformed. Nothing can be merged keyword-wise, so the
|
||||
// two agree only if they are the same declaration. (Only reached for a name
|
||||
// the base declares, so `baseProperty` is never simply absent here.)
|
||||
return !sameValue(baseProperty, branchProperty);
|
||||
}
|
||||
const left = a as Record<string, unknown>;
|
||||
const right = b as Record<string, unknown>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue