File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 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'),
198198 // at this point of time, we should have traversed all items mentioned in entrypoint and created a linear
199199 // subset of items. However, if post that, we still have items remaining in lookup object, that implies that
200200 // 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.
202202 if ( Object . keys ( entrypointLookup ) . length ) {
203- return callback ( null , [ ] ) ;
203+ return callback ( new Error ( 'Unable to find an entry point' ) ) ;
204204 }
205205
206206 // extract runnable items from the searched items.
Original file line number Diff line number Diff line change @@ -275,16 +275,18 @@ describe('extractRunnableItems', function () {
275275 ) ;
276276 } ) ;
277277
278- it ( 'should bail out if any of the given entrypoint is not found. ' , function ( done ) {
278+ it ( 'should throw an error if non-existent entry points were provided ' , function ( done ) {
279279 extractRunnableItems (
280280 collection , {
281- execute : [ 'ID3' , 'RANDOM' ] ,
282- lookupStrategy : 'multipleIdOrName'
281+ execute : [ 'RANDOM' , 'F1.R1' , 'F2.R1' ] ,
282+ lookupStrategy : 'multipleIdOrName' ,
283+ abortOnError : true
283284 } ,
284285 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 ;
287288 expect ( entrypoint ) . to . be . undefined ;
289+
288290 done ( ) ;
289291 }
290292 ) ;
You can’t perform that action at this time.
0 commit comments