fix: return native web api responses
This commit is contained in:
@@ -37,6 +37,20 @@
|
||||
" pm.response.to.be.json;",
|
||||
" }",
|
||||
" });",
|
||||
"",
|
||||
" const contentType = pm.response.headers.get(\"Content-Type\") || \"\";",
|
||||
" if (contentType.toLowerCase().includes(\"json\")) {",
|
||||
" const json = pm.response.json();",
|
||||
" const isSerializedHttpResponse = json && !Array.isArray(json) &&",
|
||||
" Object.prototype.hasOwnProperty.call(json, \"Version\") &&",
|
||||
" Object.prototype.hasOwnProperty.call(json, \"Content\") &&",
|
||||
" Object.prototype.hasOwnProperty.call(json, \"StatusCode\") &&",
|
||||
" Object.prototype.hasOwnProperty.call(json, \"IsSuccessStatusCode\");",
|
||||
"",
|
||||
" pm.test(\"Response is not a serialized HttpResponseMessage\", function () {",
|
||||
" pm.expect(isSerializedHttpResponse).to.equal(false);",
|
||||
" });",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user