1
0
Fork 0
mirror of synced 2024-07-01 12:30:41 +12:00

Use node_modules to fetch component manifest in test env

This commit is contained in:
Andrew Kingston 2021-04-07 11:16:48 +01:00
parent ac75c3cd65
commit 2ccdf54924

View file

@ -165,13 +165,7 @@ exports.downloadTemplate = async (type, name) => {
exports.getComponentLibraryManifest = async (appId, library) => {
const filename = "manifest.json"
/* istanbul ignore next */
// 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 lib = library.split("/")[1]
const path = require.resolve(library).split(lib)[0]
return require(join(path, lib, filename))
} else if (env.isDev()) {
if (env.isTest() || env.isDev()) {
const path = join(
NODE_MODULES_PATH,
"@budibase",