Skip to content

Commit 5395b27

Browse files
authored
Merge pull request #65 from node-red/v032
Fix async module loading
2 parents 241fe9b + 64ecde7 commit 5395b27

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### 0.3.2
2+
3+
- Fix async module loading @knolleary
4+
5+
16
#### 0.3.1
27

38
- Add support for async node modules (#63) @knolleary

index.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ class NodeTestHelper extends EventEmitter {
234234
library: {register: function() {}},
235235
get server() { return self._server }
236236
}
237-
238237
redNodes.init(mockRuntime);
239238
redNodes.registerType("helper", function (n) {
240239
redNodes.createNode(this, n);
@@ -281,10 +280,9 @@ class NodeTestHelper extends EventEmitter {
281280
}
282281
}
283282
});
284-
285283
return Promise.all(initPromises)
286-
.then(redNodes.loadFlows)
287-
.then(redNodes.startFlows)
284+
.then(() => redNodes.loadFlows())
285+
.then(() => redNodes.startFlows())
288286
.then(() => {
289287
should.deepEqual(testFlow, redNodes.getFlows().flows);
290288
if(cb) cb();
@@ -299,7 +297,7 @@ class NodeTestHelper extends EventEmitter {
299297

300298
// internal API
301299
this._context.clean({allNodes:[]});
302-
return this._redNodes.stopFlows();
300+
return this._redNodes.stopFlows()
303301
}
304302

305303
/**

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-test-helper",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "A test framework for Node-RED nodes",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)