File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
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 ( 'Some entrypoints are not found' ) ) ;
204204 }
205205
206206 // extract runnable items from the searched items.
Original file line number Diff line number Diff line change @@ -275,16 +275,14 @@ 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 ' ] ,
281+ execute : [ 'RANDOM ' , 'F1.R1' , 'F2.R1 '] ,
282282 lookupStrategy : 'multipleIdOrName'
283283 } ,
284- function ( err , runnableItems , entrypoint ) {
285- expect ( err ) . to . be . null ;
286- expect ( runnableItems ) . to . eql ( [ ] ) ;
287- expect ( entrypoint ) . to . be . undefined ;
284+ function ( err ) {
285+ expect ( err ) . to . be . instanceOf ( Error ) ;
288286 done ( ) ;
289287 }
290288 ) ;
You can’t perform that action at this time.
0 commit comments