File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -198,9 +198,9 @@ var sdk = require('postman-collection'),
198
198
// at this point of time, we should have traversed all items mentioned in entrypoint and created a linear
199
199
// subset of items. However, if post that, we still have items remaining in lookup object, that implies that
200
200
// extra items were present in user input and corresponding items for those do not exist in collection. As such
201
- // we need to bail out if any of the given entry-point is not found.
201
+ // we need to bail out with an error if any of the given entry-point is not found.
202
202
if ( Object . keys ( entrypointLookup ) . length ) {
203
- return callback ( null , [ ] ) ;
203
+ return callback ( new Error ( 'Unable to find an entry point' ) ) ;
204
204
}
205
205
206
206
// extract runnable items from the searched items.
Original file line number Diff line number Diff line change @@ -275,16 +275,18 @@ describe('extractRunnableItems', function () {
275
275
) ;
276
276
} ) ;
277
277
278
- it ( 'should bail out if any of the given entrypoint is not found. ' , function ( done ) {
278
+ it ( 'should bail out with an error if any of the given entrypoint is not found. ' , function ( done ) {
279
279
extractRunnableItems (
280
280
collection , {
281
- execute : [ 'ID3' , 'RANDOM' ] ,
282
- lookupStrategy : 'multipleIdOrName'
281
+ execute : [ 'RANDOM' , 'F1.R1' , 'F2.R1' ] ,
282
+ lookupStrategy : 'multipleIdOrName' ,
283
+ abortOnError : true
283
284
} ,
284
285
function ( err , runnableItems , entrypoint ) {
285
- expect ( err ) . to . be . null ;
286
- expect ( runnableItems ) . to . eql ( [ ] ) ;
286
+ expect ( err . message ) . to . equal ( 'Unable to find an entry point' ) ;
287
+ expect ( runnableItems ) . to . be . undefined ;
287
288
expect ( entrypoint ) . to . be . undefined ;
289
+
288
290
done ( ) ;
289
291
}
290
292
) ;
You can’t perform that action at this time.
0 commit comments