1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add example testCredentials object since the format is not easily understood using the link.

Derek Boytim 2018-01-23 12:03:28 -05:00
parent a241db25b7
commit b360f47540

@ -67,6 +67,17 @@ Helper script can start Node-RED server, load a flow, and receive a payload from
- `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`.
- `testFlows`: (array of objects) [Flow data](https://github.com/node-red/node-red/wiki/Flow-Format) to test a node. If you want to use the flow data exported from Node-RED editor, need to covert it to JavaScript object using JSON.parse().
- `testCredentials`: (object) [Node credentials](https://nodered.org/docs/creating-nodes/credentials). This argument is optional.
Example `testCredentials` for node "n1":
```
{
n1: {
user: "user",
password: "password"
}
}
```
- `cb`: (function) Function to call back when testFlows has been started.
The minimum script to test a flow is as follows. This case omits `testCredentials`.