From 044cfe5d2a988845d01579dab33081c8aad7ac3e Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 25 May 2023 15:14:23 +0200 Subject: [PATCH] Undo API changes from #603 --- test/parser.test.coffee | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/parser.test.coffee b/test/parser.test.coffee index 796e2c69..f2758759 100644 --- a/test/parser.test.coffee +++ b/test/parser.test.coffee @@ -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 @@ -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