wsdlrdr
Advanced tools
Comparing version 0.5.1 to 0.5.2
{ | ||
"name": "wsdlrdr", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "a simple wsdl parser, with promises", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -328,2 +328,3 @@ (() => { | ||
pushItemFound[pushKey].push(pushable[pushKey]); | ||
return store; | ||
} | ||
@@ -330,0 +331,0 @@ } |
@@ -151,2 +151,35 @@ (() => { | ||
test('getXmlDataAsJson.array', (t) => { | ||
var responseXml = `<?xml version="1.0" encoding="UTF-8"?> | ||
<SOAP-ENV:Envelope | ||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | ||
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" | ||
xmlns:tns="http://www.dataaccess.com/webservicesserver/" | ||
xmlns:cns0="header-data1" | ||
xmlns:cns1="header-data2" | ||
xmlns:cns2="header-data3"> | ||
<SOAP-ENV:Header> | ||
<cns0:header1>header-data1</cns0:header1> | ||
<cns1:header2>header-data2</cns1:header2> | ||
<cns2:header3>header-data3</cns2:header3> | ||
</SOAP-ENV:Header> | ||
<SOAP-ENV:Body> | ||
<getDataTypeResponse> | ||
<testParam1>1</testParam1> | ||
<testParam2>2</testParam2> | ||
<testParam2>3</testParam2> | ||
</getDataTypeResponse> | ||
</SOAP-ENV:Body> | ||
</SOAP-ENV:Envelope>`; | ||
var dataAsJson = Wsdlrdr.getXmlDataAsJson(responseXml); | ||
t.ok(dataAsJson.getDataTypeResponse, 'getDataTypeResponse is available'); | ||
t.ok(dataAsJson.getDataTypeResponse.filter((i) => i['testParam2']).length === 1, 'testParam2 only once'); | ||
t.end(); | ||
}); | ||
test('getXmlDataAsJson.withAttrValue', (t) => { | ||
@@ -153,0 +186,0 @@ t.plan(1); |
27704
572