From 8f9820a4845aed7c87942bde94e2ca0e4e835bb1 Mon Sep 17 00:00:00 2001 From: HirokiUchikawa Date: Thu, 7 Feb 2019 13:22:08 +0900 Subject: [PATCH] Expose nodeApp --- index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 542c6db..69d68ae 100644 --- a/index.js +++ b/index.js @@ -165,6 +165,7 @@ class NodeTestHelper extends EventEmitter { const redNodes = this._redNodes; this._httpAdmin = express(); + this._httpNode = express(); const mockRuntime = { nodes: redNodes, events: this._events, @@ -172,7 +173,7 @@ class NodeTestHelper extends EventEmitter { settings: this._settings, storage: storage, log: this._log, - nodeApp: express(), + nodeApp: this._httpNode, adminApp: this._httpAdmin, library: {register: function() {}}, get server() { return self._server } @@ -239,8 +240,12 @@ class NodeTestHelper extends EventEmitter { return this._redNodes.stopFlows(); } - request() { - return request(this._httpAdmin); + request(app) { + if(app === "httpNode"){ + return request(this._httpNode); + }else{ + return request(this._httpAdmin); + } } startServer(done) {