You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loads a flow then starts the flow. This function has the following arguments:
295
+
Return a promise to load a flow then start the flow. This function has the following arguments:
295
296
296
297
* testNode: (object|array of objects) Module object of a node to be tested returned by require function. This node will be registered, and can be used in testFlows.
297
298
* testFlow: (array of objects) Flow data to test a node. If you want to use flow data exported from Node-RED editor, export the flow to the clipboard and paste the content into your test scripts.
* cb: (function) Function to call back when testFlows has been started.
300
+
* cb: (function) Optional function to call back when testFlows has been started.
300
301
301
302
### unload()
302
303
@@ -306,9 +307,34 @@ Return promise to stop all flows, clean up test runtime.
306
307
307
308
Returns a node instance by id in the testFlow. Any node that is defined in testFlows can be retrieved, including any helper node added to the flow.
308
309
310
+
An extra method is added to the node:
311
+
312
+
* next(event)
313
+
Alternative to on(event, callback) for async/await style programming. Returns promise to find the next event in queue. If there is no events in queue, the promise itself will be queued.
314
+
315
+
If the event is input, a clone of the message will be returned.
316
+
317
+
Example:
318
+
319
+
````javascript
320
+
it('should make payload lower case', asyncfunction() {
0 commit comments