diff --git a/lib/ui5Framework/npm/Registry.js b/lib/ui5Framework/npm/Registry.js index 73cc9947b..fb678be53 100644 --- a/lib/ui5Framework/npm/Registry.js +++ b/lib/ui5Framework/npm/Registry.js @@ -72,6 +72,9 @@ class Registry { await configuration.load(); // Reads through the configurations const config = configuration.flat; // JSON. Formatted via "flatten" + // Always use our cache dir instead of the configured one + config.cache = this._cacheDir; + if (!config.proxy && !config.httpsProxy) { // Disable usage of shared keep-alive agents unless a proxy is configured // which only works with agents. diff --git a/test/lib/graph/helpers/ui5Framework.integration.js b/test/lib/graph/helpers/ui5Framework.integration.js index a989f3a31..3eec2a802 100644 --- a/test/lib/graph/helpers/ui5Framework.integration.js +++ b/test/lib/graph/helpers/ui5Framework.integration.js @@ -45,7 +45,6 @@ test.beforeEach(async (t) => { } sinon.stub(Config.prototype, "flat").value({ registry: "https://registry.fake", - cache: path.join(ui5FrameworkBaseDir, "cacache"), proxy: "" }); diff --git a/test/lib/ui5framework/npm/Registry.js b/test/lib/ui5framework/npm/Registry.js index 6fb430244..01436837b 100644 --- a/test/lib/ui5framework/npm/Registry.js +++ b/test/lib/ui5framework/npm/Registry.js @@ -77,7 +77,8 @@ test.serial("_getPacoteOptions", async (t) => { const expectedPacoteOptions = { fake: "config", - agent: false + agent: false, + cache: "cacheDir" }; npmConfigFlat.value(npmConfig); @@ -109,7 +110,8 @@ test.serial("_getPacoteOptions (proxy config set)", async (t) => { }; const expectedPacoteOptions = { - proxy: "http://localhost:9999" + proxy: "http://localhost:9999", + cache: "cacheDir" }; npmConfigFlat.value(npmConfig); @@ -134,7 +136,8 @@ test.serial("_getPacoteOptions (https-proxy config set)", async (t) => { }; const expectedPacoteOptions = { - httpsProxy: "http://localhost:9999" + httpsProxy: "http://localhost:9999", + cache: "cacheDir" }; npmConfigFlat.value(npmConfig);