From e9ceff42d51b721bad8bc8fa0041e90a0d94e820 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 25 Mar 2021 15:19:41 +0000 Subject: [PATCH] Attempting to solve component library issue permanently in test. --- packages/server/src/utilities/fileSystem/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 971eaee5fc..9f6ce3fe7e 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -162,8 +162,9 @@ exports.getComponentLibraryManifest = async (appId, library) => { // when testing in cypress and so on we need to get the package // as the environment may not be fully fleshed out for dev or prod if (env.isTest()) { - const paths = await downloadLibraries(appId) - return require(join(paths[library], "package", filename)) + const lib = library.split("/")[1] + const path = require.resolve(library).split(lib)[0] + return require(join(path, lib, filename)) } const devPath = join(budibaseTempDir(), library, filename) if (env.isDev() && fs.existsSync(devPath)) {