mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Move node install/remove from server component to node engine
This commit is contained in:
@@ -22,7 +22,6 @@ var sinon = require('sinon');
|
||||
var when = require('when');
|
||||
|
||||
var redNodes = require("../../../red/nodes");
|
||||
var server = require("../../../red/server");
|
||||
var settings = require("../../../red/settings");
|
||||
|
||||
var nodes = require("../../../red/api/nodes");
|
||||
@@ -213,7 +212,7 @@ describe("nodes api", function() {
|
||||
name:"foo",
|
||||
nodes:[{id:"123"}]
|
||||
});
|
||||
var installModule = sinon.stub(server,'installModule', function() {
|
||||
var installModule = sinon.stub(redNodes,'installModule', function() {
|
||||
return when.resolve({id:"123"});
|
||||
});
|
||||
|
||||
@@ -242,7 +241,7 @@ describe("nodes api", function() {
|
||||
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
|
||||
return {nodes:{id:"123"}};
|
||||
});
|
||||
var installModule = sinon.stub(server,'installModule', function() {
|
||||
var installModule = sinon.stub(redNodes,'installModule', function() {
|
||||
return when.resolve({id:"123"});
|
||||
});
|
||||
|
||||
@@ -268,7 +267,7 @@ describe("nodes api", function() {
|
||||
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
|
||||
return null;
|
||||
});
|
||||
var installModule = sinon.stub(server,'installModule', function() {
|
||||
var installModule = sinon.stub(redNodes,'installModule', function() {
|
||||
return when.reject(new Error("test error"));
|
||||
});
|
||||
|
||||
@@ -294,7 +293,7 @@ describe("nodes api", function() {
|
||||
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
|
||||
return null;
|
||||
});
|
||||
var installModule = sinon.stub(server,'installModule', function() {
|
||||
var installModule = sinon.stub(redNodes,'installModule', function() {
|
||||
var err = new Error("test error");
|
||||
err.code = 404;
|
||||
return when.reject(err);
|
||||
@@ -344,7 +343,7 @@ describe("nodes api", function() {
|
||||
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
|
||||
return {nodes:[{id:"123"}]};
|
||||
});
|
||||
var uninstallModule = sinon.stub(server,'uninstallModule', function() {
|
||||
var uninstallModule = sinon.stub(redNodes,'uninstallModule', function() {
|
||||
return when.resolve({id:"123"});
|
||||
});
|
||||
|
||||
@@ -398,7 +397,7 @@ describe("nodes api", function() {
|
||||
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
|
||||
return {nodes:[{id:"123"}]};
|
||||
});
|
||||
var uninstallModule = sinon.stub(server,'uninstallModule', function() {
|
||||
var uninstallModule = sinon.stub(redNodes,'uninstallModule', function() {
|
||||
return when.reject(new Error("test error"));
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user