Skip to content

Commit d3f1fba

Browse files
committed
Improving test validation and fix JSDoc from hasReference method
1 parent 478a494 commit d3f1fba

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/deref.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const _ = require('lodash'),
3333
/**
3434
* @param {*} currentNode - the object from which you're trying to find references
3535
* @param {*} seenRef References that are repeated. Used to identify circular references.
36-
* @returns {boolean} - whether the object has references
36+
* @returns {boolean} - Whether the object has circular references
3737
*/
3838
function hasReference(currentNode, seenRef) {
3939
let hasRef = false;

test/unit/base.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,17 @@ describe('CONVERT FUNCTION TESTS ', function() {
12261226
};
12271227

12281228
Converter.convert(input, { optimizeConversion: false, stackLimit: 50 }, (err, result) => {
1229+
let responseBody = JSON.parse(result.output[0].data.item[0].response[0].body);
12291230
expect(err).to.be.null;
12301231
expect(result.result).to.be.true;
1232+
expect(responseBody)
1233+
.to.have.all.keys('grandParentTypeData', 'specificType');
1234+
expect(responseBody.specificType)
1235+
.to.have.all.keys(
1236+
'grandParentTypeData',
1237+
'parentTypeData',
1238+
'specificTypeData'
1239+
);
12311240
});
12321241
});
12331242

0 commit comments

Comments
 (0)