Skip to content

Commit

Permalink
Add test for the fix of issue Leonidas-from-XIV#119
Browse files Browse the repository at this point in the history
  • Loading branch information
flexi-xu committed Mar 28, 2017
1 parent 547350e commit 6852241
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/builder.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,19 @@ module.exports =
actual = builder.buildObject obj
diffeq expected, actual
test.finish()

'test building obj with array': (test) ->
expected = """
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<MsgId>10</MsgId>
<MsgId2>12</MsgId2>
</root>
"""
opts = cdata: true
builder = new xml2js.Builder opts
obj = [{"MsgId": 10}, {"MsgId2": 12}]
actual = builder.buildObject obj
diffeq expected, actual
test.finish()

0 comments on commit 6852241

Please sign in to comment.