test: added test for self closing tags in xml-json parser (#2891)

Co-authored-by: Anusree Subash <anusree@usebruno.com>
This commit is contained in:
anusreesubash 2024-08-23 16:29:41 +05:30 committed by GitHub
parent 44d70ca02a
commit 8b76ecede3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,37 @@
meta {
name: echo xml parsed(self closing tags)
type: http
seq: 6
}
post {
url: {{host}}/api/echo/xml-parsed
body: xml
auth: none
}
body:xml {
<hello>
<world>bruno</world>
<world/>
</hello>
}
assert {
res.status: eq 200
}
tests {
test("should return parsed xml", function() {
const data = res.getBody();
expect(res.getBody()).to.eql({
"hello": {
"world": [
"bruno",
""
]
}
});
});
}