From 9bb320828a018ace0533b54a096acbbb55826ca7 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 22 Dec 2023 14:50:43 +0000 Subject: [PATCH 1/2] Ensure hooks and plugins are included in the mock runtime api --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index a5676aa..8d38f50 100644 --- a/index.js +++ b/index.js @@ -232,6 +232,8 @@ class NodeTestHelper extends EventEmitter { nodeApp: express(), adminApp: this._httpAdmin, library: {register: function() {}}, + hooks: this._RED.hooks, + plugins: this._RED.plugins, get server() { return self._server } } redNodes.init(mockRuntime); From 062251f7fb1b5b456af7581cb12cc53d028ed179 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 22 Dec 2023 15:01:17 +0000 Subject: [PATCH 2/2] Fix hooks/plugin reference --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8d38f50..9c23a32 100644 --- a/index.js +++ b/index.js @@ -232,8 +232,8 @@ class NodeTestHelper extends EventEmitter { nodeApp: express(), adminApp: this._httpAdmin, library: {register: function() {}}, - hooks: this._RED.hooks, - plugins: this._RED.plugins, + hooks: this._RED.runtime.hooks, + plugins: this._RED.runtime.plugins, get server() { return self._server } } redNodes.init(mockRuntime);