Skip to content

Commit 52e8bb7

Browse files
committed
Remove bail out behavior if one of the entrypoints does not exist
For lookupStrategy "multipleIdOrName", we should not bail out if one of the provided entrypoints does not exist. Instead we should just exlcude this invalid point.
1 parent 09e11bc commit 52e8bb7

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

lib/runner/extract-runnable-items.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,6 @@ var sdk = require('postman-collection'),
195195
});
196196
}
197197

198-
// at this point of time, we should have traversed all items mentioned in entrypoint and created a linear
199-
// subset of items. However, if post that, we still have items remaining in lookup object, that implies that
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.
202-
if (Object.keys(entrypointLookup).length) {
203-
return callback(null, []);
204-
}
205-
206198
// extract runnable items from the searched items.
207199
for (i = 0, ii = items.members.length; i < ii; i++) {
208200
runnableItems = runnableItems.concat(flattenNode(items.members[i]));

test/unit/extract-runnable-items.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,16 @@ 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 exclude non-existent entry points and return only valid items', function (done) {
279279
extractRunnableItems(
280280
collection, {
281-
execute: ['ID3', 'RANDOM'],
281+
execute: ['RANDOM', 'F1.R1', 'F2.R1'],
282282
lookupStrategy: 'multipleIdOrName'
283283
},
284284
function (err, runnableItems, entrypoint) {
285285
expect(err).to.be.null;
286-
expect(runnableItems).to.eql([]);
287-
expect(entrypoint).to.be.undefined;
286+
expect(_.map(runnableItems, 'name')).to.eql(['F1.R1', 'F2.R1']);
287+
expect(entrypoint).to.have.property('name', 'Collection C1');
288288
done();
289289
}
290290
);

0 commit comments

Comments
 (0)