Skip to content

Commit

Permalink
fix(closes #127): downgrade xmlbuilder2 dependency to 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bhovhannes committed Feb 19, 2023
1 parent 521249d commit 93bd8bc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"commander": "~10.0.0",
"fast-glob": "~3.2.11",
"xmlbuilder2": "~3.0.2"
"xmlbuilder2": "3.0.1"
},
"repository": {
"type": "git",
Expand Down
12 changes: 12 additions & 0 deletions test/e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ describe('e2e', function () {
expect(contents).toContain('failure message with ]]>')
})

it('preserves xml entities in attributes', async () => {
await mergeFiles(
fixturePaths.output,
[path.join(__dirname, 'fixtures', 'with-entities-in-attributes.xml')],
{}
)

const contents = await fsPromises.readFile(fixturePaths.output, 'utf8')
expect(contents).toContain('SingleSemicolon(&)')
expect(contents).toContain('DoubleSemicolon(&;)')
})

it('merges m*.xml files into one, matching predefined snapshot', async () => {
await mergeFiles(fixturePaths.output, fixturePaths.inputs)
const actualContents = await fsPromises.readFile(fixturePaths.output, 'utf8')
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/with-entities-in-attributes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd"
name="repro.MyTest" time="2.6" tests="1" errors="0" skipped="0" failures="1">
<properties/>
<testcase name="SingleSemicolon(&amp;)"/>
<testcase name="DoubleSemicolon(&amp;;)"/>
</testsuite>

0 comments on commit 93bd8bc

Please sign in to comment.