mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add unit tests for externalModules
This commit is contained in:
@@ -41,8 +41,8 @@ async function refreshExternalModules() {
|
||||
|
||||
function init(_settings) {
|
||||
settings = _settings;
|
||||
path.resolve(settings.userDir || process.env.NODE_RED_HOME || ".");
|
||||
|
||||
knownExternalModules = {};
|
||||
installEnabled = true;
|
||||
if (settings.externalModules && settings.externalModules.modules) {
|
||||
if (settings.externalModules.modules.allowList || settings.externalModules.modules.denyList) {
|
||||
installAllowList = settings.externalModules.modules.allowList;
|
||||
@@ -197,7 +197,6 @@ async function installModule(moduleDetails) {
|
||||
}).catch(result => {
|
||||
var output = result.stderr;
|
||||
var e;
|
||||
var lookForVersionNotFound = new RegExp("version not found: ","m");
|
||||
if (/E404/.test(output) || /ETARGET/.test(output)) {
|
||||
log.error(log._("server.install.install-failed-not-found",{name:installSpec}));
|
||||
e = new Error("Module not found");
|
||||
@@ -208,7 +207,9 @@ async function installModule(moduleDetails) {
|
||||
log.error("------------------------------------------");
|
||||
log.error(output);
|
||||
log.error("------------------------------------------");
|
||||
throw new Error(log._("server.install.install-failed"));
|
||||
e = new Error(log._("server.install.install-failed"));
|
||||
e.code = "unexpected_error";
|
||||
throw e;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user