Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
tuananh committed Sep 27, 2017
2 parents 7fe7996 + 42a287e commit dee5843
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
{
"name": "camaro",
"version": "2.0.0",
"version": "2.0.1",
"description": "Transforming XML to JSON using Node.js binding to native pugixml parser library",
"homepage": "https://github.com/tuananh/camaro",
"bugs": "https://github.com/tuananh/camaro/issues",
Expand Down
2 changes: 1 addition & 1 deletion src/pugixml
Submodule pugixml updated 1 files
+1 −1 src/pugixml.cpp
13 changes: 13 additions & 0 deletions test/function.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const xml = `
<item>hello wOrld caMaro</item>
<item>hEllO wOrlD camaRo</item>
</items>
<unicode>
<item>phòng 2 người</item>
</unicode>
</root>
`

Expand Down Expand Up @@ -46,6 +49,16 @@ t.test('test function title-case()', (t) => {
t.end()
})

t.test('test function title-case() unicode', (t) => {
const result = transform(xml, {
titleCase: ['//unicode/item', 'title-case(.)']
})
result.titleCase.forEach(u => {
t.equal(u, 'Phòng 2 Người')
})
t.end()
})

t.test('test function camel-case()', (t) => {
const result = transform(xml, {
camelCase: ['//items/item', 'camel-case(.)']
Expand Down

0 comments on commit dee5843

Please sign in to comment.