Skip to content

Commit 7dbbe64

Browse files
add description of runtime actions
1 parent bddb096 commit 7dbbe64

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/flow-tester.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
function invokeAction(kind, opt) {
3131
return $.ajax({
32-
url: "/flow-tester/executeAction/"+ kind,
32+
url: "flow-tester/executeAction/"+ kind,
3333
type: "POST",
3434
contentType: "application/json",
3535
data: JSON.stringify(opt)

src/flow-tester.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,35 @@ module.exports = (RED) => {
8787
let promise = Promise.resolve(null);
8888
switch (kind) {
8989
case "init":
90+
// initialize runtime part of flow-tester plugin
9091
promise = init();
9192
break;
9293
case "start":
94+
// waits for completion of tests
9395
promise = start();
9496
break;
9597
case "cleanup":
98+
// cleanup runtime part of flow-tester plugin
9699
promise = cleanup();
97100
break;
98101
case "send":
102+
// send a message to specified node
99103
promise = executeSend(opt.target, opt.value);
100104
break;
101105
case "matchInit":
106+
// register callback for checking output messages
102107
promise = initMatch(opt.node, opt.value);
103108
break;
104109
case "press":
105-
case "match":
110+
// press the button of target node
106111
case "recv":
107-
case "set":
112+
// receive a message from input port
113+
case "set":
114+
// set context or environment variable
108115
case "wait":
116+
// wait for specified time
109117
case "function":
118+
// execute JavaScript code
110119
default:
111120
console.log("unexpected action kind: ", kind);
112121
break;

0 commit comments

Comments
 (0)