I am trying to verify xml response as part of pact...
# pact-js
s
I am trying to verify xml response as part of pact testing using pactjs. The consumer as well as verifier works fine in case of xml response without namespace. But with namespace , PactVerifier complains with below error message " $['https://www.w3schools.com/furniture:Student']['https://www.w3schools.com/furniture:Name']['#text'] -> Expected 'John Doe 2' to be equal to 'John Doe'"
//contract body
const BODY = new XmlBuilder("1.0", "UTF-8", "f:Student").build((el) => {
el.setAttributes({
"xmlns:f":"<https://www.w3schools.com/furniture>"
})
el.appendElement("f:Name", {}, (version) => {
version.appendText(MatchersV3.string("John Doe"))
})
})
response returned by the mock api
<?xml version='1.0'?>
<f:Student xmlns:f="<https://www.w3schools.com/furniture>">
<f:Name>John Doe 2</f:Name>
</f:Student>
I am using node 18.0.0 and pactjs version 12.1.0
m