UNPKG

node-red-contrib-flow-asserter

Version:

This module is a node module that supports flow testing on the Node-RED editor UI. You can test the flow with multiple test-cases and without any changes when switching between test and production.

1 lines 2.98 kB
[{"id":"96639365.2535b","type":"debug","z":"da8c6626.1080b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":865,"y":255,"wires":[]},{"id":"14614bbd.8189d4","type":"debug","z":"da8c6626.1080b8","name":"testcase's result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":395,"y":315,"wires":[]},{"id":"bd66d7a6.3da5e8","type":"delay","z":"da8c6626.1080b8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":375,"y":255,"wires":[["fff921a.51a9fe"]]},{"id":"fff921a.51a9fe","type":"function","z":"da8c6626.1080b8","name":"msg.payload.toUpperCase","func":"msg.payload = msg.payload.toUpperCase();\n\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":255,"wires":[["9516c77.67cb238"]]},{"id":"51084472.24f87c","type":"flow-asserter in","z":"da8c6626.1080b8","name":"","testcases":[{"testId":0,"input":"aaa","inputType":"str","operator":"eq","assert":"AAA","assertType":"str"},{"testId":1,"input":"bbb","inputType":"str","operator":"eq","assert":"bbb","assertType":"str"},{"testId":2,"input":"ccc","inputType":"str","operator":"eq","assert":"CCC","assertType":"str"}],"flowasserterout":"9516c77.67cb238","x":200,"y":315,"wires":[["bd66d7a6.3da5e8"],["14614bbd.8189d4"]]},{"id":"9516c77.67cb238","type":"flow-asserter out","z":"da8c6626.1080b8","name":"","x":765,"y":315,"wires":[["96639365.2535b"]]},{"id":"c2a7b255.38e64","type":"inject","z":"da8c6626.1080b8","name":"","topic":"","payload":"aaa","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":215,"y":255,"wires":[["bd66d7a6.3da5e8"]]},{"id":"3af10b6e.bb63a4","type":"debug","z":"da8c6626.1080b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":865,"y":105,"wires":[]},{"id":"50cced2b.3b3cb4","type":"delay","z":"da8c6626.1080b8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":375,"y":105,"wires":[["ec7db30c.9442d"]]},{"id":"ec7db30c.9442d","type":"function","z":"da8c6626.1080b8","name":"msg.payload.toUpperCase","func":"msg.payload = msg.payload.toUpperCase();\n\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":105,"wires":[["3af10b6e.bb63a4"]]},{"id":"541083d1.eef69c","type":"inject","z":"da8c6626.1080b8","name":"","topic":"","payload":"aaa","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":215,"y":105,"wires":[["50cced2b.3b3cb4"]]},{"id":"92012024.64b55","type":"comment","z":"da8c6626.1080b8","name":"Add flow-asserter","info":"","x":140,"y":210,"wires":[]},{"id":"82263acc.4c26f8","type":"comment","z":"da8c6626.1080b8","name":"Intact flow","info":"","x":120,"y":60,"wires":[]}]