added more checks in test

This commit is contained in:
Dhroov Gupta
2019-07-24 11:42:23 +05:30
parent b814cc7041
commit bc77c603b3
2 changed files with 5 additions and 2 deletions

View File

@@ -510,7 +510,7 @@ module.exports = {
}
/* eslint-enable */
else {
// recurse over child leaf nodes
// recurse over child leaf nodes
// and add as children to this folder
for (i = 0, requestCount = resource.requests.length; i < requestCount; i++) {
itemGroup.items.add(
@@ -520,7 +520,7 @@ module.exports = {
// recurse over child folders
// and add as child folders to this folder
/* eslint-disable */
/* eslint-disable max-depth*/
for (subChild in resource.children) {
if (resource.children.hasOwnProperty(subChild) && resource.children[subChild].requestCount > 0) {
itemGroup.items.add(

View File

@@ -51,6 +51,9 @@ describe('CONVERT FUNCTION TESTS ', function() {
expect(conversionResult.output[0].type).to.equal('collection');
expect(conversionResult.output[0].data).to.have.property('info');
expect(conversionResult.output[0].data).to.have.property('item');
expect(conversionResult.output[0].data.item[0].name).to.equal('pets/a/b');
expect(conversionResult.output[0].data.item[0].item[0].request.method).to.equal('GET');
expect(conversionResult.output[0].data.item[0].item[1].request.method).to.equal('POST');
done();
});