Skip to content

Commit 5728757

Browse files
fixed failing tests
1 parent a942449 commit 5728757

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/unit/convertV2.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,18 @@ describe('The convert v2 Function', function() {
110110

111111
it('Should not explicitly set auth when specified on a request when passed alwaysInheritAuthentication ' +
112112
securityTestInheritance, function(done) {
113+
const isEmptyArrayOrNull = (value) => {
114+
return Array.isArray(value) && value.length === 0 || value === null;
115+
};
113116
var openapi = fs.readFileSync(securityTestInheritance, 'utf8');
114117
Converter.convertV2(
115118
{ type: 'string', data: openapi },
116119
{ alwaysInheritAuthentication: true }, (err, conversionResult) => {
117120

118121
expect(err).to.be.null;
119122
expect(conversionResult.output[0].data.auth.type).to.equal('apikey');
120-
expect(conversionResult.output[0].data.item[0].item[0].request.auth).to.be.empty;
121-
expect(conversionResult.output[0].data.item[1].item[0].request.auth).to.be.empty;
123+
expect(conversionResult.output[0].data.item[0].item[0].request.auth).to.satisfy(isEmptyArrayOrNull);
124+
expect(conversionResult.output[0].data.item[1].item[0].request.auth).to.satisfy(isEmptyArrayOrNull);
122125
done();
123126
});
124127
});

0 commit comments

Comments
 (0)