From 83cbf860aa37dfa78f6af2a3bf34a4bd3ea2a9b9 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Wed, 22 Jul 2020 18:20:19 +0200 Subject: [PATCH 1/5] [FIX] generateLibraryPreload: Ignore missing modules --- lib/tasks/bundlers/generateLibraryPreload.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/bundlers/generateLibraryPreload.js b/lib/tasks/bundlers/generateLibraryPreload.js index dd52aa4b2..0bfbab492 100644 --- a/lib/tasks/bundlers/generateLibraryPreload.js +++ b/lib/tasks/bundlers/generateLibraryPreload.js @@ -106,7 +106,8 @@ function getModuleBundlerOptions(config) { optimize: config.preload, decorateBootstrapModule: config.preload, addTryCatchRestartWrapper: config.preload, - usePredefineCalls: config.preload + usePredefineCalls: config.preload, + ignoreMissingModules: true }; moduleBundlerOptions.bundleDefinition = getSapUiCoreBunDef(config.name, config.filters, config.preload); From 2bbb83a97b412eb0e265a27dff5dedf55db507e7 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Wed, 29 Jul 2020 08:54:36 +0200 Subject: [PATCH 2/5] [INTERNAL] Rename generateLibraryPreload.js -> test/lib/tasks/bundlers/generateLibraryPreload.integration.js --- ...ateLibraryPreload.js => generateLibraryPreload.integration.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/lib/tasks/bundlers/{generateLibraryPreload.js => generateLibraryPreload.integration.js} (100%) diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.js b/test/lib/tasks/bundlers/generateLibraryPreload.integration.js similarity index 100% rename from test/lib/tasks/bundlers/generateLibraryPreload.js rename to test/lib/tasks/bundlers/generateLibraryPreload.integration.js From 2b7ed72c18b8ec8aa94a641b3d90622e777a2c18 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Wed, 29 Jul 2020 09:30:41 +0200 Subject: [PATCH 3/5] [INTERNAL] Add basic generateLibraryPreload unit test --- lib/tasks/bundlers/generateLibraryPreload.js | 6 +- .../tasks/bundlers/generateLibraryPreload.js | 103 ++++++++++++++++++ 2 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 test/lib/tasks/bundlers/generateLibraryPreload.js diff --git a/lib/tasks/bundlers/generateLibraryPreload.js b/lib/tasks/bundlers/generateLibraryPreload.js index 0bfbab492..d5ab7c9a5 100644 --- a/lib/tasks/bundlers/generateLibraryPreload.js +++ b/lib/tasks/bundlers/generateLibraryPreload.js @@ -106,8 +106,7 @@ function getModuleBundlerOptions(config) { optimize: config.preload, decorateBootstrapModule: config.preload, addTryCatchRestartWrapper: config.preload, - usePredefineCalls: config.preload, - ignoreMissingModules: true + usePredefineCalls: config.preload }; moduleBundlerOptions.bundleDefinition = getSapUiCoreBunDef(config.name, config.filters, config.preload); @@ -255,7 +254,8 @@ module.exports = function({workspace, dependencies, options}) { bundleDefinition: getBundleDefinition(libraryNamespace), bundleOptions: { optimize: true, - usePredefineCalls: true + usePredefineCalls: true, + ignoreMissingModules: true } }, resources diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.js b/test/lib/tasks/bundlers/generateLibraryPreload.js new file mode 100644 index 000000000..b9945d83a --- /dev/null +++ b/test/lib/tasks/bundlers/generateLibraryPreload.js @@ -0,0 +1,103 @@ +const test = require("ava"); +const sinon = require("sinon"); +const mock = require("mock-require"); + +test.beforeEach((t) => { + t.context.workspace = { + byGlob: sinon.stub().resolves([]), + write: sinon.stub().resolves() + }; + t.context.dependencies = {}; + t.context.comboByGlob = sinon.stub().resolves([]); + + t.context.ReaderCollectionPrioritizedStub = sinon.stub(); + t.context.ReaderCollectionPrioritizedStub.returns({ + byGlob: t.context.comboByGlob + }); + mock("@ui5/fs", { + ReaderCollectionPrioritized: t.context.ReaderCollectionPrioritizedStub + }); + + t.context.moduleBundlerStub = sinon.stub().resolves([]); + mock("../../../../lib/processors/bundlers/moduleBundler", t.context.moduleBundlerStub); + + t.context.generateLibraryPreload = mock.reRequire("../../../../lib/tasks/bundlers/generateLibraryPreload"); +}); + +test.afterEach(() => { + sinon.restore(); + mock.stopAll(); +}); + +test.serial("generateLibraryPreload should call moduleBundler with expected arguments", async (t) => { + const { + generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, + workspace, dependencies, comboByGlob + } = t.context; + + const expectedResources = [{"fake": "resource"}]; + comboByGlob.resolves(expectedResources); + + workspace.byGlob.resolves([ + {getPath: sinon.stub().returns("/resources/my/lib/.library")} + ]); + + await generateLibraryPreload({ + workspace, + dependencies, + options: { + projectName: "Test Library" + } + }); + + t.is(moduleBundlerStub.callCount, 1, "moduleBundler should have been called once"); + t.deepEqual(moduleBundlerStub.getCall(0).args, [{ + options: { + bundleDefinition: { + defaultFileTypes: [ + ".js", + ".fragment.xml", + ".view.xml", + ".properties", + ".json", + ], + name: "my/lib/library-preload.js", + sections: [ + { + filters: [ + "my/lib/", + "!my/lib/.library", + "!my/lib/designtime/", + "!my/lib/**/*.designtime.js", + "!my/lib/**/*.support.js", + "!my/lib/themes/", + "!my/lib/messagebundle*", + ], + mode: "preload", + renderer: true, + resolve: false, + resolveConditional: false, + } + ] + }, + bundleOptions: { + optimize: true, + usePredefineCalls: true, + ignoreMissingModules: true + } + }, + resources: [ + {"fake": "resource"} + ] + }]); + + t.is(workspace.byGlob.callCount, 1, + "workspace.byGlob should have been called once"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + "workspace.byGlob should have been called with expected pattern"); + + t.is(ReaderCollectionPrioritizedStub.callCount, 1, + "ReaderCollectionPrioritized should have been called once"); + t.true(ReaderCollectionPrioritizedStub.calledWithNew(), + "ReaderCollectionPrioritized should have been called with 'new'"); +}); From d173b9cc12ca81a9f2527cd647914c5362e39a31 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Thu, 30 Jul 2020 12:39:33 +0200 Subject: [PATCH 4/5] More tests + small refactoring --- lib/tasks/bundlers/generateLibraryPreload.js | 32 +- .../tasks/bundlers/generateLibraryPreload.js | 544 +++++++++++++++++- 2 files changed, 553 insertions(+), 23 deletions(-) diff --git a/lib/tasks/bundlers/generateLibraryPreload.js b/lib/tasks/bundlers/generateLibraryPreload.js index d5ab7c9a5..22f6e4761 100644 --- a/lib/tasks/bundlers/generateLibraryPreload.js +++ b/lib/tasks/bundlers/generateLibraryPreload.js @@ -2,6 +2,18 @@ const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateLib const moduleBundler = require("../../processors/bundlers/moduleBundler"); const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; +function getDefaultLibraryPreloadFilters(namespace) { + return [ + `${namespace}/`, + `!${namespace}/.library`, + `!${namespace}/designtime/`, + `!${namespace}/**/*.designtime.js`, + `!${namespace}/**/*.support.js`, + `!${namespace}/themes/`, + `!${namespace}/messagebundle*` + ]; +} + function getBundleDefinition(namespace) { // TODO: move to config of actual core project if (namespace === "sap/ui/core") { @@ -21,15 +33,9 @@ function getBundleDefinition(namespace) { { mode: "preload", filters: [ - `${namespace}/`, - `!${namespace}/.library`, - `!${namespace}/designtime/`, - `!${namespace}/**/*.designtime.js`, - `!${namespace}/**/*.support.js`, - `!${namespace}/themes/`, - `!${namespace}/cldr/`, - `!${namespace}/messagebundle*`, + ...getDefaultLibraryPreloadFilters(namespace), + `!${namespace}/cldr/`, "*.js", "sap/base/", "sap/ui/base/", @@ -69,15 +75,7 @@ function getBundleDefinition(namespace) { sections: [ { mode: "preload", - filters: [ - `${namespace}/`, - `!${namespace}/.library`, - `!${namespace}/designtime/`, - `!${namespace}/**/*.designtime.js`, - `!${namespace}/**/*.support.js`, - `!${namespace}/themes/`, - `!${namespace}/messagebundle*` - ], + filters: getDefaultLibraryPreloadFilters(namespace), resolve: false, resolveConditional: false, renderer: true diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.js b/test/lib/tasks/bundlers/generateLibraryPreload.js index b9945d83a..7175b29fd 100644 --- a/test/lib/tasks/bundlers/generateLibraryPreload.js +++ b/test/lib/tasks/bundlers/generateLibraryPreload.js @@ -29,14 +29,16 @@ test.afterEach(() => { mock.stopAll(); }); -test.serial("generateLibraryPreload should call moduleBundler with expected arguments", async (t) => { +test.serial("generateLibraryPreload", async (t) => { const { generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, workspace, dependencies, comboByGlob } = t.context; - const expectedResources = [{"fake": "resource"}]; - comboByGlob.resolves(expectedResources); + const resources = [ + {getPath: sinon.stub().returns("/resources/my/lib/.library")} + ]; + comboByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/my/lib/.library")} @@ -86,9 +88,539 @@ test.serial("generateLibraryPreload should call moduleBundler with expected argu ignoreMissingModules: true } }, - resources: [ - {"fake": "resource"} - ] + resources + }]); + + t.is(workspace.byGlob.callCount, 1, + "workspace.byGlob should have been called once"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + "workspace.byGlob should have been called with expected pattern"); + + t.is(ReaderCollectionPrioritizedStub.callCount, 1, + "ReaderCollectionPrioritized should have been called once"); + t.true(ReaderCollectionPrioritizedStub.calledWithNew(), + "ReaderCollectionPrioritized should have been called with 'new'"); +}); + +test("generateLibraryPreload for sap.ui.core (w/o ui5loader.js)", async (t) => { + const { + generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, + workspace, dependencies, comboByGlob + } = t.context; + + const resources = [ + {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")}, + {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} + ]; + const filteredResources = [resources[0]]; // without sap-ui-core.js + comboByGlob.resolves(resources); + + workspace.byGlob.resolves([ + {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} + ]); + + await generateLibraryPreload({ + workspace, + dependencies, + options: { + projectName: "sap.ui.core" + } + }); + + t.is(moduleBundlerStub.callCount, 5, "moduleBundler should have been called 5 times"); + t.deepEqual(moduleBundlerStub.getCall(0).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core.js", + sections: [ + { + filters: [ + "jquery.sap.global.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "preload", + filters: [ + "sap/ui/core/Core.js" + ], + resolve: true + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: true, + decorateBootstrapModule: true, + addTryCatchRestartWrapper: true, + usePredefineCalls: true + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(1).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core-dbg.js", + sections: [ + { + filters: [ + "jquery.sap.global.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: false, + decorateBootstrapModule: false, + addTryCatchRestartWrapper: false, + usePredefineCalls: false + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(2).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core-nojQuery.js", + sections: [ + { + mode: "provided", + filters: [ + "jquery-ui-core.js", + "jquery-ui-datepicker.js", + "jquery-ui-position.js", + "sap/ui/thirdparty/jquery.js", + "sap/ui/thirdparty/jquery/*", + "sap/ui/thirdparty/jqueryui/*" + ] + }, + { + filters: [ + "jquery.sap.global.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "preload", + filters: [ + "sap/ui/core/Core.js" + ], + resolve: true + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: true, + decorateBootstrapModule: true, + addTryCatchRestartWrapper: true, + usePredefineCalls: true + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(3).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core-nojQuery-dbg.js", + sections: [ + { + mode: "provided", + filters: [ + "jquery-ui-core.js", + "jquery-ui-datepicker.js", + "jquery-ui-position.js", + "sap/ui/thirdparty/jquery.js", + "sap/ui/thirdparty/jquery/*", + "sap/ui/thirdparty/jqueryui/*" + ] + }, + { + filters: [ + "jquery.sap.global.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: false, + decorateBootstrapModule: false, + addTryCatchRestartWrapper: false, + usePredefineCalls: false + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(4).args, [{ + options: { + bundleDefinition: { + defaultFileTypes: [ + ".js", + ".fragment.xml", + ".view.xml", + ".properties", + ".json", + ], + name: "sap/ui/core/library-preload.js", + sections: [ + { + filters: [ + "ui5loader-autoconfig.js", + "sap/ui/core/Core.js", + ], + mode: "provided", + resolve: true, + }, + { + filters: [ + "sap/ui/core/", + "!sap/ui/core/.library", + "!sap/ui/core/designtime/", + "!sap/ui/core/**/*.designtime.js", + "!sap/ui/core/**/*.support.js", + "!sap/ui/core/themes/", + "!sap/ui/core/messagebundle*", + + "!sap/ui/core/cldr/", + "*.js", + "sap/base/", + "sap/ui/base/", + "sap/ui/dom/", + "sap/ui/events/", + "sap/ui/model/", + "sap/ui/security/", + "sap/ui/util/", + "sap/ui/Global.js", + "sap/ui/thirdparty/crossroads.js", + "sap/ui/thirdparty/caja-htmlsanitizer.js", + "sap/ui/thirdparty/hasher.js", + "sap/ui/thirdparty/signals.js", + "sap/ui/thirdparty/jquery-mobile-custom.js", + "sap/ui/thirdparty/jqueryui/jquery-ui-core.js", + "sap/ui/thirdparty/jqueryui/jquery-ui-position.js", + "!sap-ui-*.js", + "!sap/ui/core/support/", + "!sap/ui/core/plugin/DeclarativeSupport.js", + "!sap/ui/core/plugin/LessSupport.js", + ], + mode: "preload", + renderer: true, + resolve: false, + resolveConditional: false, + } + ] + }, + bundleOptions: { + optimize: true, + usePredefineCalls: true, + ignoreMissingModules: true + } + }, + resources: filteredResources + }]); + + t.is(workspace.byGlob.callCount, 1, + "workspace.byGlob should have been called once"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + "workspace.byGlob should have been called with expected pattern"); + + t.is(ReaderCollectionPrioritizedStub.callCount, 1, + "ReaderCollectionPrioritized should have been called once"); + t.true(ReaderCollectionPrioritizedStub.calledWithNew(), + "ReaderCollectionPrioritized should have been called with 'new'"); +}); + + +test("generateLibraryPreload for sap.ui.core (/w ui5loader.js)", async (t) => { + const { + generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, + workspace, dependencies, comboByGlob + } = t.context; + + const resources = [ + {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")}, + {getPath: sinon.stub().returns("/resources/ui5loader.js")}, + {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} + ]; + const filteredResources = [resources[0], resources[1]]; // without sap-ui-core.js + comboByGlob.resolves(resources); + + workspace.byGlob.resolves([ + {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} + ]); + + await generateLibraryPreload({ + workspace, + dependencies, + options: { + projectName: "sap.ui.core" + } + }); + + t.is(moduleBundlerStub.callCount, 5, "moduleBundler should have been called 5 times"); + t.deepEqual(moduleBundlerStub.getCall(0).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core.js", + sections: [ + { + filters: [ + "ui5loader-autoconfig.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "preload", + filters: [ + "sap/ui/core/Core.js" + ], + resolve: true + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: true, + decorateBootstrapModule: true, + addTryCatchRestartWrapper: true, + usePredefineCalls: true + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(1).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core-dbg.js", + sections: [ + { + filters: [ + "ui5loader-autoconfig.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: false, + decorateBootstrapModule: false, + addTryCatchRestartWrapper: false, + usePredefineCalls: false + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(2).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core-nojQuery.js", + sections: [ + { + mode: "provided", + filters: [ + "jquery-ui-core.js", + "jquery-ui-datepicker.js", + "jquery-ui-position.js", + "sap/ui/thirdparty/jquery.js", + "sap/ui/thirdparty/jquery/*", + "sap/ui/thirdparty/jqueryui/*" + ] + }, + { + filters: [ + "ui5loader-autoconfig.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "preload", + filters: [ + "sap/ui/core/Core.js" + ], + resolve: true + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: true, + decorateBootstrapModule: true, + addTryCatchRestartWrapper: true, + usePredefineCalls: true + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(3).args, [{ + options: { + bundleDefinition: { + name: "sap-ui-core-nojQuery-dbg.js", + sections: [ + { + mode: "provided", + filters: [ + "jquery-ui-core.js", + "jquery-ui-datepicker.js", + "jquery-ui-position.js", + "sap/ui/thirdparty/jquery.js", + "sap/ui/thirdparty/jquery/*", + "sap/ui/thirdparty/jqueryui/*" + ] + }, + { + filters: [ + "ui5loader-autoconfig.js" + ], + mode: "raw", + resolve: true, + sort: true, + declareModules: false + }, + { + mode: "require", + filters: [ + "sap/ui/core/Core.js" + ] + } + ] + }, + bundleOptions: { + optimize: false, + decorateBootstrapModule: false, + addTryCatchRestartWrapper: false, + usePredefineCalls: false + } + }, + resources: filteredResources + }]); + t.deepEqual(moduleBundlerStub.getCall(4).args, [{ + options: { + bundleDefinition: { + defaultFileTypes: [ + ".js", + ".fragment.xml", + ".view.xml", + ".properties", + ".json", + ], + name: "sap/ui/core/library-preload.js", + sections: [ + { + filters: [ + "ui5loader-autoconfig.js", + "sap/ui/core/Core.js", + ], + mode: "provided", + resolve: true, + }, + { + filters: [ + "sap/ui/core/", + "!sap/ui/core/.library", + "!sap/ui/core/designtime/", + "!sap/ui/core/**/*.designtime.js", + "!sap/ui/core/**/*.support.js", + "!sap/ui/core/themes/", + "!sap/ui/core/messagebundle*", + + "!sap/ui/core/cldr/", + "*.js", + "sap/base/", + "sap/ui/base/", + "sap/ui/dom/", + "sap/ui/events/", + "sap/ui/model/", + "sap/ui/security/", + "sap/ui/util/", + "sap/ui/Global.js", + "sap/ui/thirdparty/crossroads.js", + "sap/ui/thirdparty/caja-htmlsanitizer.js", + "sap/ui/thirdparty/hasher.js", + "sap/ui/thirdparty/signals.js", + "sap/ui/thirdparty/jquery-mobile-custom.js", + "sap/ui/thirdparty/jqueryui/jquery-ui-core.js", + "sap/ui/thirdparty/jqueryui/jquery-ui-position.js", + "!sap-ui-*.js", + "!sap/ui/core/support/", + "!sap/ui/core/plugin/DeclarativeSupport.js", + "!sap/ui/core/plugin/LessSupport.js", + ], + mode: "preload", + renderer: true, + resolve: false, + resolveConditional: false, + } + ] + }, + bundleOptions: { + optimize: true, + usePredefineCalls: true, + ignoreMissingModules: true + } + }, + resources: filteredResources }]); t.is(workspace.byGlob.callCount, 1, From ecdc7bf2700242bccbcf84b3a8d33b06fe76fea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20O=C3=9Fwald?= <1410947+matz3@users.noreply.github.com> Date: Fri, 31 Jul 2020 14:27:34 +0200 Subject: [PATCH 5/5] Update test/lib/tasks/bundlers/generateLibraryPreload.js Co-authored-by: Merlin Beutlberger --- test/lib/tasks/bundlers/generateLibraryPreload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.js b/test/lib/tasks/bundlers/generateLibraryPreload.js index 7175b29fd..da3867e7a 100644 --- a/test/lib/tasks/bundlers/generateLibraryPreload.js +++ b/test/lib/tasks/bundlers/generateLibraryPreload.js @@ -24,7 +24,7 @@ test.beforeEach((t) => { t.context.generateLibraryPreload = mock.reRequire("../../../../lib/tasks/bundlers/generateLibraryPreload"); }); -test.afterEach(() => { +test.afterEach.always(() => { sinon.restore(); mock.stopAll(); });