mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Update externalModules_spec to handle variable npm args length
This commit is contained in:
parent
676f790933
commit
00caa13a12
@ -48,13 +48,14 @@ describe("externalModules api", function() {
|
|||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
sinon.stub(exec,"run").callsFake(async function(cmd, args, options) {
|
sinon.stub(exec,"run").callsFake(async function(cmd, args, options) {
|
||||||
let error;
|
let error;
|
||||||
if (args[2] === "moduleNotFound") {
|
let moduleName = args[args.length-1];
|
||||||
|
if (moduleName === "moduleNotFound") {
|
||||||
error = new Error();
|
error = new Error();
|
||||||
error.stderr = "E404";
|
error.stderr = "E404";
|
||||||
} else if (args[2] === "moduleVersionNotFound") {
|
} else if (moduleName === "moduleVersionNotFound") {
|
||||||
error = new Error();
|
error = new Error();
|
||||||
error.stderr = "ETARGET";
|
error.stderr = "ETARGET";
|
||||||
} else if (args[2] === "moduleFail") {
|
} else if (moduleName === "moduleFail") {
|
||||||
error = new Error();
|
error = new Error();
|
||||||
error.stderr = "Some unexpected install error";
|
error.stderr = "Some unexpected install error";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user