Skip to content

Commit

Permalink
Add test for #25
Browse files Browse the repository at this point in the history
  • Loading branch information
oozcitak committed Jun 22, 2020
1 parent 64650d6 commit 365929c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/issues/issue-025.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import $$ from "../TestHelpers";

describe("Replicate issue", () => {
// https://github.com/oozcitak/xmlbuilder2/issues/25
test("#25 - Custom converter", () => {
const obj = {
'root': {
'@xmlns:ns': 'some/uri',
'ns:node1': 'Some text',
'ns:node2': 1234
}
}

expect($$.create(obj).end({ headless: true, prettyPrint: true })).toBe($$.t`
<root xmlns:ns="some/uri">
<ns:node1>Some text</ns:node1>
<ns:node2>1234</ns:node2>
</root>
`)
})

})

0 comments on commit 365929c

Please sign in to comment.