diff --git a/lib/runner/extract-runnable-items.js b/lib/runner/extract-runnable-items.js index f15bd52f7..490f19938 100644 --- a/lib/runner/extract-runnable-items.js +++ b/lib/runner/extract-runnable-items.js @@ -195,14 +195,6 @@ var sdk = require('postman-collection'), }); } - // at this point of time, we should have traversed all items mentioned in entrypoint and created a linear - // subset of items. However, if post that, we still have items remaining in lookup object, that implies that - // extra items were present in user input and corresponding items for those do not exist in collection. As such - // we need to bail out if any of the given entry-point is not found. - if (Object.keys(entrypointLookup).length) { - return callback(null, []); - } - // extract runnable items from the searched items. for (i = 0, ii = items.members.length; i < ii; i++) { runnableItems = runnableItems.concat(flattenNode(items.members[i])); diff --git a/test/unit/extract-runnable-items.test.js b/test/unit/extract-runnable-items.test.js index 1baab5365..4191a301c 100644 --- a/test/unit/extract-runnable-items.test.js +++ b/test/unit/extract-runnable-items.test.js @@ -275,16 +275,16 @@ describe('extractRunnableItems', function () { ); }); - it('should bail out if any of the given entrypoint is not found. ', function (done) { + it('should exclude non-existent entry points and return only valid items', function (done) { extractRunnableItems( collection, { - execute: ['ID3', 'RANDOM'], + execute: ['RANDOM', 'F1.R1', 'F2.R1'], lookupStrategy: 'multipleIdOrName' }, function (err, runnableItems, entrypoint) { expect(err).to.be.null; - expect(runnableItems).to.eql([]); - expect(entrypoint).to.be.undefined; + expect(_.map(runnableItems, 'name')).to.eql(['F1.R1', 'F2.R1']); + expect(entrypoint).to.have.property('name', 'Collection C1'); done(); } );