Fix up unit tests

This commit is contained in:
Nick O'Leary
2018-12-04 15:59:43 +00:00
parent 2060af8a92
commit ee47646cf7
10 changed files with 235 additions and 155 deletions

View File

@@ -63,8 +63,13 @@ module.exports = {
}
redUtil.init(userSettings);
if (userSettings.httpAdminRoot !== false) {
// Initialise the runtime
runtime.init(userSettings,httpServer,api);
// Initialise the editor-api
api.init(userSettings,httpServer,runtime.storage,runtime);
// Attach the runtime admin app to the api admin app
api.httpAdmin.use(runtime.httpAdmin);
apiEnabled = true;
server = httpServer;
} else {
@@ -107,15 +112,17 @@ module.exports = {
util: redUtil.util,
get nodes() { console.log("Deprecated use of RED.nodes - refer to API documentation on RED.runtime.nodes"); return runtime._.nodes },
get settings() { console.log("Deprecated use of RED.settings - refer to API documentation on RED.runtime.settings"); return runtime._.settings },
get version() { console.log("Deprecated use of RED.version - refer to API documentation on RED.runtime.version"); return runtime._.version },
get events() { console.log("Deprecated use of RED.events - refer to API documentation on RED.runtime.events"); return runtime.events },
get settings() { return runtime._.settings },
get version() { return runtime._.version },
/**
* The express application for the Editor Admin API
* @memberof node-red
*/
get httpAdmin() { return api.adminApp },
get httpAdmin() { return api.httpAdmin },
/**
* The express application for HTTP Nodes