From 6b529f9b792393548b784e49dae7c52353f63114 Mon Sep 17 00:00:00 2001 From: Tobias Sorn Date: Fri, 28 Aug 2020 17:40:13 +0200 Subject: [PATCH] [INTERNAL] LocatorResourcePool: pass through constructor arguments (#509) * [INTERNAL] LocatorResourcePool: pass through constructor arguments ignoreMissingModules parameter is passed along now when creating a new LocatorResourcePool To achieve this constructor is removed --- lib/lbt/resources/LocatorResourcePool.js | 5 ----- test/lib/lbt/resources/LocatorResourcePool.js | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 test/lib/lbt/resources/LocatorResourcePool.js diff --git a/lib/lbt/resources/LocatorResourcePool.js b/lib/lbt/resources/LocatorResourcePool.js index c617bac4b..104051584 100644 --- a/lib/lbt/resources/LocatorResourcePool.js +++ b/lib/lbt/resources/LocatorResourcePool.js @@ -1,12 +1,7 @@ const ResourcePool = require("./ResourcePool"); const LocatorResource = require("./LocatorResource"); - class LocatorResourcePool extends ResourcePool { - constructor() { - super(); - } - prepare(resources) { resources = resources.filter( (res) => !res.getStatInfo().isDirectory() ); return Promise.all( diff --git a/test/lib/lbt/resources/LocatorResourcePool.js b/test/lib/lbt/resources/LocatorResourcePool.js new file mode 100644 index 000000000..f23e16bc4 --- /dev/null +++ b/test/lib/lbt/resources/LocatorResourcePool.js @@ -0,0 +1,8 @@ +const test = require("ava"); +const LocatorResourcePool = require("../../../../lib/lbt/resources/LocatorResourcePool"); + +test("getIgnoreMissingModules", async (t) => { + const resourcePool = new LocatorResourcePool({ignoreMissingModules: true}); + t.true(resourcePool.getIgnoreMissingModules(), "ignoreMissingModules is true"); +}); +