Skip to content

Commit

Permalink
Undo API changes from #603
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidas-from-XIV committed May 25, 2023
1 parent 7292aa9 commit 044cfe5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/parser.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,13 @@ module.exports =

'test single attrNameProcessors': skeleton(attrNameProcessors: [nameToUpperCase], (r)->
console.log 'Result object: ' + util.inspect r, false, 10
equ {}.hasOwnProperty.call(r.sample.attrNameProcessTest[0].$, 'CAMELCASEATTR'), true
equ {}.hasOwnProperty.call(r.sample.attrNameProcessTest[0].$, 'LOWERCASEATTR'), true)
equ r.sample.attrNameProcessTest[0].$.hasOwnProperty('CAMELCASEATTR'), true
equ r.sample.attrNameProcessTest[0].$.hasOwnProperty('LOWERCASEATTR'), true)

'test multiple attrNameProcessors': skeleton(attrNameProcessors: [nameToUpperCase, nameCutoff], (r)->
console.log 'Result object: ' + util.inspect r, false, 10
equ {}.hasOwnProperty.call(r.sample.attrNameProcessTest[0].$, 'CAME'), true
equ {}.hasOwnProperty.call(r.sample.attrNameProcessTest[0].$, 'LOWE'), true)
equ r.sample.attrNameProcessTest[0].$.hasOwnProperty('CAME'), true
equ r.sample.attrNameProcessTest[0].$.hasOwnProperty('LOWE'), true)

'test single attrValueProcessors': skeleton(attrValueProcessors: [nameToUpperCase], (r)->
console.log 'Result object: ' + util.inspect r, false, 10
Expand All @@ -575,21 +575,21 @@ module.exports =

'test single tagNameProcessors': skeleton(tagNameProcessors: [nameToUpperCase], (r)->
console.log 'Result object: ' + util.inspect r, false, 10
equ {}.hasOwnProperty.call(r, 'SAMPLE'), true
equ {}.hasOwnProperty.call(r.SAMPLE, 'TAGNAMEPROCESSTEST'), true)
equ r.hasOwnProperty('SAMPLE'), true
equ r.SAMPLE.hasOwnProperty('TAGNAMEPROCESSTEST'), true)

'test single tagNameProcessors in simple callback': (test) ->
fs.readFile fileName, (err, data) ->
xml2js.parseString data, tagNameProcessors: [nameToUpperCase], (err, r)->
console.log 'Result object: ' + util.inspect r, false, 10
equ {}.hasOwnProperty.call(r, 'SAMPLE'), true
equ {}.hasOwnProperty.call(r.SAMPLE, 'TAGNAMEPROCESSTEST'), true
equ r.hasOwnProperty('SAMPLE'), true
equ r.SAMPLE.hasOwnProperty('TAGNAMEPROCESSTEST'), true
test.finish()

'test multiple tagNameProcessors': skeleton(tagNameProcessors: [nameToUpperCase, nameCutoff], (r)->
console.log 'Result object: ' + util.inspect r, false, 10
equ {}.hasOwnProperty.call(r, 'SAMP'), true
equ {}.hasOwnProperty.call(r.SAMP, 'TAGN'), true)
equ r.hasOwnProperty('SAMP'), true
equ r.SAMP.hasOwnProperty('TAGN'), true)

'test attrValueProcessors key param': skeleton(attrValueProcessors: [replaceValueByName], (r)->
console.log 'Result object: ' + util.inspect r, false, 10
Expand Down

0 comments on commit 044cfe5

Please sign in to comment.