Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Addresses review feedback on PR #154 regarding weak test assertions in json-to-xml.test.tsx.

Changes

  • Replace string inclusion checks with DOM-based assertions in the "should convert simple string JSON" test
    • Parse output XML into DOM structure
    • Verify root element and structure
    • Extract and validate actual text content from text nodes

Before/After

// Before: passes even if structure is wrong
assert(outXmlString.includes('hello'));

// After: validates actual DOM structure
const outXml = xmlParser.xmlParse(outXmlString);
assert.equal(outXml.documentElement.nodeName, 'result');
const child = outXml.documentElement.firstChild;
const textContent = extractTextContent(child);
assert.equal(textContent, 'hello');

The test now catches structural regressions that substring matching would miss (wrong element names, incorrect nesting, malformed output).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 23, 2026 21:58
Co-authored-by: leonelsanchesdasilva <53848829+leonelsanchesdasilva@users.noreply.github.com>
Co-authored-by: leonelsanchesdasilva <53848829+leonelsanchesdasilva@users.noreply.github.com>
Copilot AI changed the title [WIP] Work in progress to address feedback on reapplying changes Strengthen json-to-xml test assertions with DOM validation Jan 23, 2026
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