Problem
parseAriaTemplate('') throws an error:
Error: Aria snapshot must be a YAML sequence, elements starting with " -"
An empty string is a valid aria tree representation (e.g. when all content is aria-hidden="true"), so parseAriaTemplate should return an empty fragment node instead of throwing.
Context
This blocks the fix for vitest#10158 (toMatchAriaInlineSnapshot('') cannot match empty aria trees). The vitest-side fix (vitest-dev/vitest#10188) correctly distinguishes "" from undefined, but when the empty string reaches parseAriaTemplate, it throws.
Expected behavior
parseAriaTemplate('') should return { kind: 'role', role: 'fragment' } — an empty fragment with no children.
Problem
parseAriaTemplate('')throws an error:An empty string is a valid aria tree representation (e.g. when all content is
aria-hidden="true"), soparseAriaTemplateshould return an empty fragment node instead of throwing.Context
This blocks the fix for vitest#10158 (
toMatchAriaInlineSnapshot('')cannot match empty aria trees). The vitest-side fix (vitest-dev/vitest#10188) correctly distinguishes""fromundefined, but when the empty string reachesparseAriaTemplate, it throws.Expected behavior
parseAriaTemplate('')should return{ kind: 'role', role: 'fragment' }— an empty fragment with no children.