mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Updating tests to use the new responseBody signature
This commit is contained in:
@@ -405,6 +405,10 @@ module.exports = {
|
||||
* @returns {string} string
|
||||
*/
|
||||
insertSpacesInName: function (string) {
|
||||
if (!string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// convert createUser to create User
|
||||
string = string.replace(/([a-z])([A-Z])/g, '$1 $2');
|
||||
|
||||
|
||||
@@ -853,7 +853,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
|
||||
it('with undefined ContentObj', function() {
|
||||
var contentObj,
|
||||
pmResponseBody;
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
|
||||
expect(pmResponseBody).to.equal('');
|
||||
});
|
||||
it('with Content-Type application/json', function() {
|
||||
@@ -879,7 +879,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
|
||||
},
|
||||
pmResponseBody;
|
||||
Utils.options.schemaFaker = true;
|
||||
pmResponseBody = JSON.parse(Utils.convertToPmResponseBody(contentObj));
|
||||
pmResponseBody = JSON.parse(Utils.convertToPmResponseBody(contentObj).responseBody);
|
||||
expect(pmResponseBody.id).to.equal('<long>');
|
||||
expect(pmResponseBody.name).to.equal('<string>');
|
||||
});
|
||||
@@ -893,7 +893,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
|
||||
},
|
||||
pmResponseBody;
|
||||
Utils.options.schemaFaker = true;
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
|
||||
expect(typeof pmResponseBody).to.equal('string');
|
||||
});
|
||||
it('with Content-Type application/xml', function() {
|
||||
@@ -909,7 +909,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
|
||||
},
|
||||
pmResponseBody;
|
||||
Utils.options.schemaFaker = true;
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
|
||||
expect(typeof pmResponseBody).to.equal('string');
|
||||
});
|
||||
it('with Content-Type application/javascript', function() {
|
||||
@@ -919,7 +919,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
|
||||
},
|
||||
pmResponseBody;
|
||||
Utils.options.schemaFaker = true;
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
|
||||
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
|
||||
expect(typeof pmResponseBody).to.equal('string');
|
||||
});
|
||||
// things remaining application/xml, application/javascript
|
||||
|
||||
Reference in New Issue
Block a user