Comparing version
@@ -5,2 +5,3 @@ "use strict"; | ||
var diff_1 = require("./diff"); | ||
var fast_xml_parser_1 = require("fast-xml-parser"); | ||
var deepDiff = require('deep-diff').diff; | ||
@@ -52,2 +53,7 @@ var ActualResponse = (function () { | ||
} | ||
else if ('content-type' in this.headers && this.headers['content-type'].startsWith('text/xml')) { | ||
var jsonDiff = this.diffJson(fast_xml_parser_1.parse(this.body), fast_xml_parser_1.parse(expectedResponse.body)); | ||
if (jsonDiff) | ||
diff = diff.concat(jsonDiff); | ||
} | ||
else if (expectedResponse.body !== this.body) { | ||
@@ -54,0 +60,0 @@ diff.push(new diff_1.Diff("Body assertion failed. Expected '" + this.getStringValue(expectedResponse.body) + "' to equal to '" + this.getStringValue(this.body) + "'")); |
{ | ||
"name": "apiunit", | ||
"version": "2.1.16", | ||
"version": "2.2.0", | ||
"description": "Unit testing framework for API", | ||
@@ -33,2 +33,3 @@ "main": "dist/index.js", | ||
"deep-diff": "^1.0.0", | ||
"fast-xml-parser": "^3.19.0", | ||
"http-file": "^1.0.3", | ||
@@ -35,0 +36,0 @@ "json-path": "^0.1.3", |
73904
0.54%1538
0.39%17
6.25%+ Added
+ Added
+ Added