Skip to content

Commit 2f07eed

Browse files
committed
Don't use "async" so we don't require ES2017.
1 parent 73f154f commit 2f07eed

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

index.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class NodeTestHelper extends EventEmitter {
118118
}
119119
}
120120

121-
async load(testNode, testFlow, testCredentials, cb) {
121+
load(testNode, testFlow, testCredentials, cb) {
122122
const log = this._log;
123123
const logSpy = this._logSpy = this._sandbox.spy(log, 'log');
124124
logSpy.FATAL = log.FATAL;
@@ -193,12 +193,14 @@ class NodeTestHelper extends EventEmitter {
193193
testNode(red);
194194
}
195195

196-
await redNodes.loadFlows();
197-
redNodes.startFlows();
198-
should.deepEqual(testFlow, redNodes.getFlows().flows);
199-
if (typeof cb === 'function') {
200-
cb();
201-
}
196+
return redNodes.loadFlows()
197+
.then(() => {
198+
redNodes.startFlows();
199+
should.deepEqual(testFlow, redNodes.getFlows().flows);
200+
if (typeof cb === 'function') {
201+
cb();
202+
}
203+
});
202204
}
203205

204206
unload() {
@@ -236,7 +238,7 @@ class NodeTestHelper extends EventEmitter {
236238

237239
const cloneMessage = this._RED.util.cloneMessage;
238240

239-
node.next = async function(event) {
241+
node.next = function(event) {
240242
if (node.testhelper[event].args.length > 0) {
241243
return node.testhelper[event].args.shift();
242244
}

0 commit comments

Comments
 (0)