From 4f71d7851bfc7e948a037c43f4b070f80c10d65c Mon Sep 17 00:00:00 2001 From: Jim Turner Date: Mon, 6 Nov 2017 15:59:57 -0800 Subject: [PATCH] Fix race condition in tests due to incorrect stub. The startFlows() function wasn't really being stubbed, so it was still being called. But there was no corresponding call to stopFlows(). In later tests, the check in Flows.init() was throwing the "Cannot init without a stop" error. --- test/red/runtime/nodes/index_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/red/runtime/nodes/index_spec.js b/test/red/runtime/nodes/index_spec.js index a26474a24..b76378784 100644 --- a/test/red/runtime/nodes/index_spec.js +++ b/test/red/runtime/nodes/index_spec.js @@ -26,11 +26,11 @@ var registry = require("../../../../red/runtime/nodes/registry"); describe("red/nodes/index", function() { before(function() { - sinon.stub(flows,"startFlows"); + sinon.stub(index,"startFlows"); process.env.NODE_RED_HOME = path.resolve(path.join(__dirname,"..","..","..","..")) }); after(function() { - flows.startFlows.restore(); + index.startFlows.restore(); delete process.env.NODE_RED_HOME; });