File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -110,15 +110,18 @@ describe('The convert v2 Function', function() {
110
110
111
111
it ( 'Should not explicitly set auth when specified on a request when passed alwaysInheritAuthentication ' +
112
112
securityTestInheritance , function ( done ) {
113
+ const isEmptyArrayOrNull = ( value ) => {
114
+ return Array . isArray ( value ) && value . length === 0 || value === null ;
115
+ } ;
113
116
var openapi = fs . readFileSync ( securityTestInheritance , 'utf8' ) ;
114
117
Converter . convertV2 (
115
118
{ type : 'string' , data : openapi } ,
116
119
{ alwaysInheritAuthentication : true } , ( err , conversionResult ) => {
117
120
118
121
expect ( err ) . to . be . null ;
119
122
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 ) ;
122
125
done ( ) ;
123
126
} ) ;
124
127
} ) ;
You can’t perform that action at this time.
0 commit comments