@gregoriusrippenstein/erlang-red-unittest 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +4 -2
  2. package/examples/.core/support JS hash naming in variable access.json +1 -0
  3. package/examples/.elixir/support basic module code.json +1 -0
  4. package/examples/.jsonata/$privdir operator.json +1 -0
  5. package/examples/.jsonata/$replace should be working for newlines.json +1 -0
  6. package/examples/.jsonata/$type operator.json +1 -0
  7. package/examples/.jsonata/ensure that $millis() works.json +1 -0
  8. package/examples/.jsonata/non-string key names.json +1 -0
  9. package/examples/.jsonata/split function.json +1 -0
  10. package/examples/.jsonata/support array definition.json +1 -0
  11. package/examples/batch/basic behaviour.json +1 -0
  12. package/examples/binary/initial test.json +1 -0
  13. package/examples/binary/parse PNG image data.json +1 -0
  14. package/examples/captureio/Capture io from function node.json +1 -0
  15. package/examples/captureio/Mutliple captures.json +1 -0
  16. package/examples/captureio/capture io from gen_server behaviour.json +1 -0
  17. package/examples/captureio/collect io from event handlers.json +1 -0
  18. package/examples/captureio/collect io from state machine node.json +1 -0
  19. package/examples/catch/catch all exceptions in a single group.json +1 -0
  20. package/examples/catch/catch all in group except those handler elsewhere.json +1 -0
  21. package/examples/catch/deal with it yourself.json +1 -0
  22. package/examples/catch/don't catch if the node isn't selected.json +1 -0
  23. package/examples/change/debug message if no catch node.json +1 -0
  24. package/examples/change/set functionality.json +1 -0
  25. package/examples/change/support buffer type.json +1 -0
  26. package/examples/change/support num types.json +1 -0
  27. package/examples/change/support underscores in binary, hex & octal values.json +1 -0
  28. package/examples/clientcode/Client code node test.json +1 -0
  29. package/examples/complete/avoid endless recursion.json +1 -0
  30. package/examples/complete/avoid recursion - test case 2.json +1 -0
  31. package/examples/complete/its complete nodes all the way down.json +1 -0
  32. package/examples/complete/split node.json +1 -0
  33. package/examples/complete/when is a join complete.json +1 -0
  34. package/examples/csv-decode/comma separated, parse numbers & msg per row.json +1 -0
  35. package/examples/csv-decode/separators other than comma.json +1 -0
  36. package/examples/csv-decode/single message for entire CSV, comma, RFC4180.json +1 -0
  37. package/examples/csv-decode/single message per line.json +1 -0
  38. package/examples/csv-decode/skip line happens before parsing content.json +1 -0
  39. package/examples/csv-encode/line termination and separator.json +1 -0
  40. package/examples/csv-encode/simple object.json +1 -0
  41. package/examples/debug/ensure debug messages are generated.json +1 -0
  42. package/examples/debug/handle largish json files as content.json +1 -0
  43. package/examples/debug/handling of Jsonata expressions.json +1 -0
  44. package/examples/debug/only debug specific property.json +1 -0
  45. package/examples/debug/status message counter.json +1 -0
  46. package/examples/debug/type hadling of JSONata reslults (ered).json +1 -0
  47. package/examples/debug/type hadling of JSONata reslults (node-red).json +1 -0
  48. package/examples/delay/delay messages by 5 seconds.json +1 -0
  49. package/examples/delay/delay multiple message for the same length of time.json +1 -0
  50. package/examples/delay/need to provide a status message of queue size.json +1 -0
  51. package/examples/eventhandler/handle kill exits.json +1 -0
  52. package/examples/eventhandler/handle normal exits.json +1 -0
  53. package/examples/eventhandler/multiple dynamic event handlers.json +1 -0
  54. package/examples/eventhandler/register and unregister handler.json +1 -0
  55. package/examples/eventhandler/static configuration.json +1 -0
  56. package/examples/eventhandler/static handler with arguments.json +1 -0
  57. package/examples/eventhandler/static handler: multiple instances.json +1 -0
  58. package/examples/eventhandler/used with a supervisor node.json +1 -0
  59. package/examples/exec/async with noisy command.json +1 -0
  60. package/examples/exec/empty commands are not supported.json +1 -0
  61. package/examples/exec/generate complete msg once command is done.json +1 -0
  62. package/examples/exec/handle multiple process at once.json +1 -0
  63. package/examples/exec/support timeout specification.json +1 -0
  64. package/examples/exec/synchronised execution.json +1 -0
  65. package/examples/file in/basic functionality of being able to read a file.json +1 -0
  66. package/examples/file in/error when file not found.json +1 -0
  67. package/examples/file in/warning if no file name is defined.json +1 -0
  68. package/examples/file in/will accept file name from msg obj.json +1 -0
  69. package/examples/filter/ignore initial value per topic.json +1 -0
  70. package/examples/filter/ignore initial value.json +1 -0
  71. package/examples/filter/post if value changed.json +1 -0
  72. package/examples/flowhubpull/retrieve flow id.json +1 -0
  73. package/examples/function/divide by zero throws kills node.json +1 -0
  74. package/examples/function/ensure /"on stop/" code is executed.json" +1 -0
  75. package/examples/function/function and module work together.json +1 -0
  76. package/examples/function/handle corrupt code.json +1 -0
  77. package/examples/function/return values are important.json +1 -0
  78. package/examples/function/set node context.json +1 -0
  79. package/examples/function/speaks Erlang.json +1 -0
  80. package/examples/function/supervisor interaction.json +1 -0
  81. package/examples/function/support multiple outputs.json +1 -0
  82. package/examples/function/support not returning a message.json +1 -0
  83. package/examples/function/support timeout setting.json +1 -0
  84. package/examples/function/supports completed node.json +1 -0
  85. package/examples/genserver/addressing modules.json +1 -0
  86. package/examples/genserver/triggering functionality.json +1 -0
  87. package/examples/http/Dynamic Routing.json +1 -0
  88. package/examples/http/POST & GET have different endpoints.json +1 -0
  89. package/examples/http/dynamic redirect.json +1 -0
  90. package/examples/http/have params in the path.json +1 -0
  91. package/examples/http/http static routing.json +1 -0
  92. package/examples/http/multiple endpoints don't all get the request.json +1 -0
  93. package/examples/http/nodes should be able to handle requests.json +1 -0
  94. package/examples/http/post requests - json content.json +1 -0
  95. package/examples/{f38603a59963386c/flows.json → http/request parses JSON conent.json } +1 -1
  96. package/examples/http/request, ensure url and method are handled.json +1 -0
  97. package/examples/http/set content type.json +1 -0
  98. package/examples/http/support query string on get request.json +1 -0
  99. package/examples/inject/repeat interval.json +1 -0
  100. package/examples/inject/support octal, binary & hex underscore values.json +1 -0
  101. package/examples/inject/trigger after - does not trigger.json +1 -0
  102. package/examples/inject/unsupported JSONata function.json +1 -0
  103. package/examples/join/manual config with count & nested property name.json +1 -0
  104. package/examples/json/parse example json content.json +1 -0
  105. package/examples/json/raise exception if content not valid.json +1 -0
  106. package/examples/json/support prettify json content.json +1 -0
  107. package/examples/link nodes/across flow tabs.json +1 -0
  108. package/examples/link nodes/cascading link calls.json +1 -0
  109. package/examples/markdown/allow for inline html.json +1 -0
  110. package/examples/markdown/convert markdown to html.json +1 -0
  111. package/examples/markdown/support code block.json +1 -0
  112. package/examples/module/Using with Statemachine.json +1 -0
  113. package/examples/module/Using with function node.json +1 -0
  114. package/examples/mqtt/auto-(re)connect.json +1 -0
  115. package/examples/noop/Noop node will error out.json +1 -0
  116. package/examples/process/Can send messages.json +1 -0
  117. package/examples/range/basic examples.json +1 -0
  118. package/examples/split/Array type.json +1 -0
  119. package/examples/split/binary type.json +1 -0
  120. package/examples/split/using strings and buffers.json +1 -0
  121. package/examples/split/work with binary data as string data.json +1 -0
  122. package/examples/statemachine/Representing gen_statem in Erlang-Red.json +1 -0
  123. package/examples/statemachine/combined with supervisor.json +1 -0
  124. package/examples/statemachine/exception if no action to perform.json +1 -0
  125. package/examples/status/basic working version.json +1 -0
  126. package/examples/status/only one message per status value.json +1 -0
  127. package/examples/status/source map inside the status map.json +1 -0
  128. package/examples/supervisor/inform user if config needs updating.json +1 -0
  129. package/examples/supervisor/multiple individual supervisors.json +1 -0
  130. package/examples/supervisor/order defined by Y coordinate..json +1 -0
  131. package/examples/supervisor/restart after exit call.json +1 -0
  132. package/examples/supervisor/supervising two function nodes.json +1 -0
  133. package/examples/supervisor/supervisor loops.json +1 -0
  134. package/examples/supervisor/supervisor of supervisor of supervisor of .....json +1 -0
  135. package/examples/supervisor/supervisor told to stop.json +1 -0
  136. package/examples/supervisor/supervisor tree.json +1 -0
  137. package/examples/supervisor/two supervisors cannot supervise the same nodes.json +1 -0
  138. package/examples/supervisor/unsupported configrations.json +1 -0
  139. package/examples/switch/JSONata undefined value & exceptions.json +1 -0
  140. package/examples/switch/post debug on JSONata exception.json +1 -0
  141. package/examples/switch/raise exception if JSONata has exception.json +1 -0
  142. package/examples/tcp/Bad value on output port (3425).json +1 -0
  143. package/examples/tcp/multiple tcp in connectors (1194).json +1 -0
  144. package/examples/tcp/request node - disconnect immediately (1001).json +1 -0
  145. package/examples/tcp/tcp-out node in reply mode (1202).json +1 -0
  146. package/examples/tcp/transfer string between nodes (1201).json +1 -0
  147. package/examples/template/handle base64 encoded data.json +1 -0
  148. package/examples/template/support mustache template.json +1 -0
  149. package/examples/trigger/initial example.json +1 -0
  150. package/nodes/ut-assert-debug.js +66 -17
  151. package/nodes/ut-assert-values.js +179 -161
  152. package/package.json +1 -1
  153. package/plugins/sidebar.html +57 -75
  154. package/examples/069552b2eb6bce48/flows.json +0 -265
  155. package/examples/08183069b5f8ef9c/flows.json +0 -156
  156. package/examples/084fb0fc954b7156/flows.json +0 -132
  157. package/examples/090eb2d5d71fd45f/flows.json +0 -158
  158. package/examples/0c35d269ca7178c6/flows.json +0 -443
  159. package/examples/0cc95e44532c14ec/flows.json +0 -94
  160. package/examples/16b0bc0cdb0c5807/flows.json +0 -1
  161. package/examples/16b254125478329a/flows.json +0 -114
  162. package/examples/182731f54d855071/flows.json +0 -52
  163. package/examples/1ace9e051618db79/flows.json +0 -125
  164. package/examples/1c1d2cb981cf9f01/flows.json +0 -120
  165. package/examples/1db9c9a1b92e0263/flows.json +0 -172
  166. package/examples/20eeaf41372f7b17/flows.json +0 -62
  167. package/examples/27804627fb8f56bd/flows.json +0 -178
  168. package/examples/2a2c508260b96236/flows.json +0 -141
  169. package/examples/34f859d75b76d03c/flows.json +0 -200
  170. package/examples/36846ad6698e1bc0/flows.json +0 -163
  171. package/examples/3be6bc074c7647bd/flows.json +0 -319
  172. package/examples/44f12f6e4a455084/flows.json +0 -272
  173. package/examples/45209c67f865ce73/flows.json +0 -1
  174. package/examples/4657dbc0aa4a97bb/flows.json +0 -268
  175. package/examples/47514a335b4cd67e/flows.json +0 -362
  176. package/examples/486c1412721bb241/flows.json +0 -525
  177. package/examples/51bfa9456b1745c0/flows.json +0 -639
  178. package/examples/538be5947c639b32/flows.json +0 -75
  179. package/examples/545871d31c3f5f3f/flows.json +0 -376
  180. package/examples/55f105cfd894b06c/flows.json +0 -121
  181. package/examples/57d44c342a1f00e2/flows.json +0 -1
  182. package/examples/597ee2a683d9908f/flows.json +0 -129
  183. package/examples/59da63b5adb460db/flows.json +0 -188
  184. package/examples/61142eb3e4e54eab/flows.json +0 -536
  185. package/examples/64445798b59d2630/flows.json +0 -257
  186. package/examples/6d46e3fe1f2245b8/flows.json +0 -86
  187. package/examples/6dd3a5754f83dc2e/flows.json +0 -232
  188. package/examples/6ff45e2a0ce77393/flows.json +0 -131
  189. package/examples/700c94899fdd3334/flows.json +0 -107
  190. package/examples/7581c2be261f9c17/flows.json +0 -1874
  191. package/examples/7ecfd18f58fc6510/flows.json +0 -1
  192. package/examples/7fea9696f6186962/flows.json +0 -141
  193. package/examples/80655e5d4035fa71/flows.json +0 -215
  194. package/examples/8421f37b6c40e1ec/flows.json +0 -1
  195. package/examples/866410b56fa42447/flows.json +0 -1076
  196. package/examples/89aeaeef64509bed/flows.json +0 -101
  197. package/examples/8a627c9bfe3b4aff/flows.json +0 -552
  198. package/examples/96f6f83dcab507e5/flows.json +0 -105
  199. package/examples/9746601768c3b3b6/flows.json +0 -93
  200. package/examples/9942fa1aeb1b2428/flows.json +0 -2346
  201. package/examples/9b1023c95a2613cc/flows.json +0 -141
  202. package/examples/9d11bfc3a6d88535/flows.json +0 -301
  203. package/examples/9e7ccc97f80d9afb/flows.json +0 -93
  204. package/examples/9f0d6c3ad7798a77/flows.json +0 -142
  205. package/examples/9f7351d7a7304584/flows.json +0 -83
  206. package/examples/a123cd431f1967cd/flows.json +0 -1757
  207. package/examples/a4c9cabf4b335488/flows.json +0 -86
  208. package/examples/a916165378c446e3/flows.json +0 -240
  209. package/examples/ae38b2dbd23d1681/flows.json +0 -3089
  210. package/examples/ae8a9b0bbbaff447/flows.json +0 -271
  211. package/examples/b07b511dc8bb8339/flows.json +0 -92
  212. package/examples/b1501de32c769cf2/flows.json +0 -94
  213. package/examples/b5fbcdbffb568569/flows.json +0 -1
  214. package/examples/b723353a316fa50e/flows.json +0 -1
  215. package/examples/b864b3e3510cd120/flows.json +0 -205
  216. package/examples/bdbe94d065f3b3a6/flows.json +0 -143
  217. package/examples/bfced61e72c69715/flows.json +0 -616
  218. package/examples/c0b1cf6656eac77f/flows.json +0 -518
  219. package/examples/c381b5135cc947cd/flows.json +0 -272
  220. package/examples/c4690c0a085d6ef5/flows.json +0 -145
  221. package/examples/c5f513bc380bc30a/flows.json +0 -696
  222. package/examples/cfa8595b2e2b8269/flows.json +0 -255
  223. package/examples/d17fb2553fe8013a/flows.json +0 -157
  224. package/examples/d61182e87a604efa/flows.json +0 -340
  225. package/examples/eb24c92ce5621760/flows.json +0 -141
  226. package/examples/eb447048178f6e16/flows.json +0 -201
  227. package/examples/eed68dbcecd1431f/flows.json +0 -204
  228. package/examples/ef61f644d5436dbe/flows.json +0 -1
  229. package/examples/f19fdae0c02b4f03/flows.json +0 -1008
  230. package/examples/f2f61ec9fc46a468/flows.json +0 -575
  231. package/examples/f346d45c81f595e5/flows.json +0 -501
  232. package/examples/f5f82ca50317fda7/flows.json +0 -121
  233. package/examples/f946aafaebb1398d/flows.json +0 -135
  234. package/examples/f94db507552f4934/flows.json +0 -165
  235. package/examples/fb50bac16667fc54/flows.json +0 -364
  236. /package/examples/{684b9066e98b9722/flows.json → .core/Disabled node should not be sent messages.json} +0 -0
  237. /package/examples/{0e54563ba63b1501/flows.json → .core/assert values ignores failures if requested.json} +0 -0
  238. /package/examples/{7b77600dcf78933f/flows.json → .core/attribute parsing.json} +0 -0
  239. /package/examples/{93c6e969dcf84e70/flows.json → .core/ensure that message ids don't change.json} +0 -0
  240. /package/examples/{d206746f9f2594a6/flows.json → .jsonata/$match operator.json} +0 -0
  241. /package/examples/{37883612d913fd66/flows.json → .jsonata/$not operator.json} +0 -0
  242. /package/examples/{caccb020fce3f485/flows.json → .jsonata/$pad function.json} +0 -0
  243. /package/examples/{a862ae412a70ded1/flows.json → .jsonata/$substring functionality.json} +0 -0
  244. /package/examples/{0b299a3175fc0df1/flows.json → .jsonata/array indexing both forwards and backwards.json} +0 -0
  245. /package/examples/{2037454a5ee0d6c3/flows.json → .jsonata/basic support for JSONata.json} +0 -0
  246. /package/examples/{3e9e526b992d4c48/flows.json → .jsonata/ensure random is seeded.json} +0 -0
  247. /package/examples/{e7184b7ca4f07907/flows.json → .jsonata/sum arrays of objects.json} +0 -0
  248. /package/examples/{218350f2e240a15d/flows.json → .jsonata/support $keys function.json} +0 -0
  249. /package/examples/{b50f775ae3b74d38/flows.json → .jsonata/testing the modulo operator.json} +0 -0
  250. /package/examples/{1658196c31549916/flows.json → batch/batch until batch is full.json} +0 -0
  251. /package/examples/{c843dacf753a19d8/flows.json → batch/ensure batch size of 1 works.json} +0 -0
  252. /package/examples/{9a1bdfdcd7b2be8e/flows.json → batch/performance.json} +0 -0
  253. /package/examples/{538d2f4704cd2eca/flows.json → catch/ensure source is inside error map.json} +0 -0
  254. /package/examples/{6a9ffd45c418497b/flows.json → catch/file not found exception.json} +0 -0
  255. /package/examples/{71f65246c742cfc9/flows.json → catch/multiple nodes in one flow is possible.json} +0 -0
  256. /package/examples/{ed621e03921c13de/flows.json → catch/uncaught catch - part 2 - work.json} +0 -0
  257. /package/examples/{f5bdafa844f6d280/flows.json → catch/uncaught catches.json} +0 -0
  258. /package/examples/{9c51a179141515b2/flows.json → change/change functionality.json} +0 -0
  259. /package/examples/{ea246f68766c8630/flows.json → change/delete functionality.json} +0 -0
  260. /package/examples/{30465efe017cc9b0/flows.json → change/delete nested keys.json} +0 -0
  261. /package/examples/{ced70c769db825eb/flows.json → change/ensure rules are expected in order.json} +0 -0
  262. /package/examples/{7dae2b1a7881c607/flows.json → change/move functionality.json} +0 -0
  263. /package/examples/{92054e0dd22f14c6/flows.json → change/raises an exception if JSONata has exception.json} +0 -0
  264. /package/examples/{b85795a24882502b/flows.json → change/set support nested properties.json} +0 -0
  265. /package/examples/{c28048d859db3773/flows.json → change/support boolean types.json} +0 -0
  266. /package/examples/{12572f9ac11e1786/flows.json → change/support json values in the set.json} +0 -0
  267. /package/examples/{def45a46c8f4da72/flows.json → change/support nested array indicies - setting & getting & deleting.json} +0 -0
  268. /package/examples/{0cb8971e5f88ed1e/flows.json → change/support nested keys on the set operation.json} +0 -0
  269. /package/examples/{48d9fdcde317974e/flows.json → change/support timestamp type.json} +0 -0
  270. /package/examples/{1bac0a78e0a36ec0/flows.json → comment/what is there to test?.json} +0 -0
  271. /package/examples/{b9cd19107a5145c4/flows.json → complete/disabled nodes don't receive.json} +0 -0
  272. /package/examples/{5e07acf2da13b504/flows.json → complete/ensure the altered msg object is sent.json} +0 -0
  273. /package/examples/{01b074cfa6ae8818/flows.json → complete/link nodes.json} +0 -0
  274. /package/examples/{cd44a688eb2ab3cf/flows.json → complete/messags from unconnected inject.json} +0 -0
  275. /package/examples/{30c79fc42a5c35eb/flows.json → complete/only handle messages from listened to nodes.json} +0 -0
  276. /package/examples/{f8727464c799eb22/flows.json → complete/switch node isn't compatible with complete.json} +0 -0
  277. /package/examples/{b2a67e301fabab0e/flows.json → debug/handle the button press to active and deactive debug output.json} +0 -0
  278. /package/examples/{a6dc7002d0a8640e/flows.json → debug/if not active, no debug message in panel.json} +0 -0
  279. /package/examples/{b1463d7bbf545725/flows.json → debug/inactive debug nodes still count messages.json} +0 -0
  280. /package/examples/{5a06352874fa379d/flows.json → debug/only send debug message to server console if asked to.json} +0 -0
  281. /package/examples/{c1370220fd37968e/flows.json → delay/ignore msg.delay if its not set.json} +0 -0
  282. /package/examples/{d17062b01c4a9435/flows.json → delay/random between two values.json} +0 -0
  283. /package/examples/{3ea113b4ec3b6e5e/flows.json → delay/set delay via msg.delay.json} +0 -0
  284. /package/examples/{e2a801d2b3e2143f/flows.json → exec/add payload and append arguments.json} +0 -0
  285. /package/examples/{b98d0b05a760ad79/flows.json → exec/execute simple command.json} +0 -0
  286. /package/examples/{6ea4c6b373eeaa8d/flows.json → filter/narrowband no topic.json} +0 -0
  287. /package/examples/{cef9dd7dc179b8b3/flows.json → filter/value differ by topic.json} +0 -0
  288. /package/examples/{b2fcc5806b2715c0/flows.json → inject/JSONata undefined value & exceptions.json} +0 -0
  289. /package/examples/{09aab59a2455cf15/flows.json → inject/Payload, topic and fubar set on inject.json} +0 -0
  290. /package/examples/{8180ae5891c673de/flows.json → inject/ensure that topic is set correctly.json} +0 -0
  291. /package/examples/{1eb35963b752eca9/flows.json → inject/json support for properties other than payload.json} +0 -0
  292. /package/examples/{61847d719e50f83f/flows.json → inject/jsonata support for both payload and other properties.json} +0 -0
  293. /package/examples/{459322e0f8e0b785/flows.json → inject/nested hash & array support.json} +0 -0
  294. /package/examples/{c163c627bd2a37c7/flows.json → inject/support boolean type.json} +0 -0
  295. /package/examples/{7e1d04570c6bdff9/flows.json → inject/support jsonata for topic values.json} +0 -0
  296. /package/examples/{1a196bce3e57f5c1/flows.json → inject/support nested property names.json} +0 -0
  297. /package/examples/{2a12af161b544aa1/flows.json → inject/support num types.json} +0 -0
  298. /package/examples/{ec921769b3c24fb6/flows.json → inject/support the msg property type.json} +0 -0
  299. /package/examples/{9ff2e8ab21d922c5/flows.json → inject/trigger once - default value.json} +0 -0
  300. /package/examples/{1d3326a724ecbea0/flows.json → join/automatic mode.json} +0 -0
  301. /package/examples/{24f35eaa8656755f/flows.json → join/count overrides parts, complete overrides count.json} +0 -0
  302. /package/examples/{987cd33b9cda8529/flows.json → join/manual configration with count and property name.json} +0 -0
  303. /package/examples/{50d5679818477b66/flows.json → join/manual configuration counting messages.json} +0 -0
  304. /package/examples/{894f6e38bfd1aca6/flows.json → join/remove parts once matched.json} +0 -0
  305. /package/examples/{5cf6aec7d688fce4/flows.json → join/results are not ordered by index.json} +0 -0
  306. /package/examples/{d5424657b497d5af/flows.json → join/useparts with count value.json} +0 -0
  307. /package/examples/{77854a5ea962257b/flows.json → join/useparts without count value.json} +0 -0
  308. /package/examples/{f1e71f2ccb34fd6e/flows.json → join/wait for complete until messages are sent.json} +0 -0
  309. /package/examples/{d4ce58359ff6ff96/flows.json → join/with parts until complete received.json} +0 -0
  310. /package/examples/{b3f365d0b7d1f97d/flows.json → json/overwrite the attribute.json} +0 -0
  311. /package/examples/{e1ced3b16782f7c8/flows.json → junction/should just pass on the message.json} +0 -0
  312. /package/examples/{51870a76d1aaf67a/flows.json → link nodes/_linkSource support.json} +0 -0
  313. /package/examples/{bbb1fc2d47c3cd5f/flows.json → link nodes/basic test whether out and in can connect.json} +0 -0
  314. /package/examples/{15c2fad089960984/flows.json → link nodes/dynamic targets and timeout.json} +0 -0
  315. /package/examples/{c274a07715a87ca4/flows.json → link nodes/exception if dynamic link does not exist.json} +0 -0
  316. /package/examples/{9463eba0ab843567/flows.json → link nodes/exception if multiple link nodes match.json} +0 -0
  317. /package/examples/{641ddaab2819c61d/flows.json → link nodes/flow for call and returning.json} +0 -0
  318. /package/examples/{b6d4e4592b27a344/flows.json → link nodes/implement time out on link call node.json} +0 -0
  319. /package/examples/{c6ee6e89a51c98fc/flows.json → link nodes/link call - return to sender.json} +0 -0
  320. /package/examples/{38616d22e1569aa5/flows.json → link nodes/link call to a dynamic link in node - by name.json} +0 -0
  321. /package/examples/{5433b57035d597f9/flows.json → link nodes/link call to a dynamic link in node - by node id.json} +0 -0
  322. /package/examples/{213803d61ecfde3a/flows.json → link nodes/mutliple links.json} +0 -0
  323. /package/examples/{b7ebaf91f4d66ab3/flows.json → sort/array of objects.json} +0 -0
  324. /package/examples/{cffa610c817beb43/flows.json → sort/msg.complete is not respected.json} +0 -0
  325. /package/examples/{5f6929bb3374b782/flows.json → sort/sort by parts.index.json} +0 -0
  326. /package/examples/{b1430ea37ba7cc19/flows.json → split/array split.json} +0 -0
  327. /package/examples/{4de34883c5d93dc3/flows.json → split/len value is the array split size.json} +0 -0
  328. /package/examples/{2c59ef974b2523ba/flows.json → split/nested parts.json} +0 -0
  329. /package/examples/{02b18fc0ed9de178/flows.json → split/parts id is identical.json} +0 -0
  330. /package/examples/{435d3b48dd0f462c/flows.json → split/silently ignore integer as a value to split.json} +0 -0
  331. /package/examples/{5cd133958df17529/flows.json → switch/catch all v. stop after first.json} +0 -0
  332. /package/examples/{562c518969666f24/flows.json → switch/empty, non-empty, null & not-null operators.json} +0 -0
  333. /package/examples/{3edda6bd788f88c2/flows.json → switch/ensure JSONata support.json} +0 -0
  334. /package/examples/{2c1c291ec8466bfb/flows.json → switch/handle is true & is false.json} +0 -0
  335. /package/examples/{59aa8a866d8d7a70/flows.json → switch/handle nested values.json} +0 -0
  336. /package/examples/{def56742e02f6a75/flows.json → switch/property is not defined on msg object.json} +0 -0
  337. /package/examples/{f4c4a57e77439a1b/flows.json → switch/regular expression operator.json} +0 -0
  338. /package/examples/{ce2f98273da05245/flows.json → switch/support otherwise /"catchall/" rule.json"} +0 -0
  339. /package/examples/{0616f795a4aee63e/flows.json → switch/working JSONata expression operator.json} +0 -0
  340. /package/examples/{84a5a362cafe703f/flows.json → tcp/request node - stream of strings (1101).json} +0 -0
  341. /package/examples/{6f0dcbf18234c5e2/flows.json → tcp/tcp in node connect to (9393).json} +0 -0
  342. /package/examples/{2a95a7b40a798878/flows.json → tcp/telnet server (2323).json} +0 -0
  343. /package/examples/{698b83b8aeb5d5b6/flows.json → template/contains plain text and no mustache content.json} +0 -0
  344. /package/examples/{63ca9baf860d1d8f/flows.json → template/support Json encoding.json} +0 -0
  345. /package/examples/{3ed472eab9503b4f/flows.json → template/support logic in logicless mustache template.json} +0 -0
  346. /package/examples/{ad2bf1089481dcfb/flows.json → trigger/extend timer.json} +0 -0
  347. /package/examples/{8bc7412d6a4869c6/flows.json → trigger/loops of triggers.json} +0 -0
  348. /package/examples/{55f7fbe90e5befa8/flows.json → trigger/msg.delay overrides the configured delay.json} +0 -0
  349. /package/examples/{34d211e37618313c/flows.json → trigger/override via delay but no delay set.json} +0 -0
  350. /package/examples/{988f27b9abdde6e9/flows.json → trigger/send both messages on one pipe.json} +0 -0
  351. /package/examples/{338c5b411f4edfe8/flows.json → trigger/send first but not second message.json} +0 -0
  352. /package/examples/{5d4908af3d4f95e5/flows.json → trigger/send second message only.json} +0 -0
  353. /package/examples/{d595c53abba88f72/flows.json → trigger/the noop trigger.json} +0 -0
  354. /package/examples/{1566e453a88578a9/flows.json → trigger/two outputs.json} +0 -0
@@ -1,32 +1,30 @@
1
- module.exports = function(RED) {
1
+ module.exports = function (RED) {
2
2
  function CoreutassertvaluesFunctionality(config) {
3
- RED.nodes.createNode(this,config);
3
+ RED.nodes.createNode(this, config);
4
4
 
5
5
  var node = this;
6
6
  var cfg = config;
7
-
8
7
 
9
8
  //
10
9
  //
11
10
  // Helper Code
12
11
  //
13
- //
12
+ //
13
+ var sendToDebugImmediately = (nde, rule, msgc, lvl) => {
14
+ try {
15
+ let msg = {
16
+ id: nde.id,
17
+ z: nde.z,
18
+ _alias: nde._alias,
19
+ path: nde._flow.path,
20
+ name: nde.name,
21
+ topic: msgc.topic,
22
+ msg: { msg: msgc, rule: rule },
23
+ level: lvl
24
+ }
14
25
 
15
- var sendToDebug = (nde,rule,msgc,lvl) => {
16
- try {
17
- let msg = {
18
- id: nde.id,
19
- z: nde.z,
20
- _alias: nde._alias,
21
- path: nde._flow.path,
22
- name: nde.name,
23
- topic: msgc.topic,
24
- msg: {msg: msgc, rule: rule},
25
- level: lvl
26
- }
26
+ msg = RED.util.encodeObject(msg);
27
27
 
28
- msg = RED.util.encodeObject(msg);
29
- if (!cfg.ignore_failure_if_succeed) {
30
28
  // don't post debug, causes error in the editor because the flow does not
31
29
  // exist in the workspace of the editor - flow is loaded in the backend only.
32
30
  if (!msg._unittest_triggered) {
@@ -36,17 +34,26 @@ module.exports = function(RED) {
36
34
  node.log(`ASSERT FAILURE [${node.z}] assert values failed`)
37
35
  console.log(msg)
38
36
  }
37
+ } catch (ex) {
38
+ console.error(ex)
39
39
  }
40
- } catch (ex) {
41
- console.error(ex)
42
- }
43
- return ["failure", rule];
40
+ return ["failure", rule];
41
+ }
42
+
43
+ var sendToDebug = (nde, rule, msgc, lvl) => {
44
+ if (!cfg.ignore_failure_if_succeed) {
45
+ return sendToDebugImmediately(nde, rule, msgc, lvl)
46
+ }
47
+ return ["failure", rule];
44
48
  }
45
49
 
46
50
  var postUnsupported = (rule, msg) => {
47
- node.status({ fill: "red", shape: "dot",
48
- text: RED._("ut-assert-values.label.unsupported", { property: JSON.stringify(rule) }) });
49
- sendToDebug(node, rule, msg, 30)
51
+ node.status({
52
+ fill: "red", shape: "dot",
53
+ text: RED._("ut-assert-values.label.unsupported", { property: JSON.stringify(rule) })
54
+ });
55
+
56
+ sendToDebugImmediately(node, rule, msg, 30)
50
57
 
51
58
  RED.comms.publish("unittesting:testresults", {
52
59
  flowid: node.z,
@@ -67,7 +74,7 @@ module.exports = function(RED) {
67
74
  //
68
75
 
69
76
  /* initialise and close handler - if removed is false, then this is an initailise */
70
- node.on('close', function(removed, done) {
77
+ node.on('close', function (removed, done) {
71
78
  if (removed) {
72
79
  if ((!node.context().get("succeed") && !cfg.ignore_failure_if_succeed) || !node.context().get("received_message")) {
73
80
  RED.comms.publish("unittesting:testresults", {
@@ -76,7 +83,7 @@ module.exports = function(RED) {
76
83
  })
77
84
 
78
85
  node.status({ fill: "red", shape: "dot", text: "assert failed" })
79
-
86
+
80
87
  // use node.log(..) here because node.error(..) sends a message to the debug
81
88
  // panel but that errors out because the frontend can't find the workspace:
82
89
  // Uncaught TypeError: can't access property "label", RED.nodes.workspace(...) is undefined
@@ -87,7 +94,7 @@ module.exports = function(RED) {
87
94
  } else {
88
95
  node.log(`FAILED [${node.z}] Assert values node failed`)
89
96
  }
90
- }
97
+ }
91
98
  } else {
92
99
  // node was restarted
93
100
  node.status({});
@@ -99,186 +106,197 @@ module.exports = function(RED) {
99
106
  });
100
107
 
101
108
  /* msg handler, in this case pass the message on unchanged */
102
- node.on("input", function(msg, send, done) {
103
- var failures = [];
104
- var unsupported = [];
105
- node.context().set("received_message", true)
109
+ node.on("input", function (msg, send, done) {
110
+ var failures = [];
111
+ var unsupported = [];
112
+ node.context().set("received_message", true)
106
113
 
107
- try {
108
- cfg.rules.forEach(rule => {
109
- /*
110
- * Rule is Equal
111
- */
112
- if ( rule.t == "eql" && rule.pt == "msg") {
113
- if ( rule.tot == "str") {
114
- if ( rule.to != escapeSpecials(RED.util.getObjectProperty(msg,rule.p)) ) {
115
- rule._vt = escapeSpecials(RED.util.getObjectProperty(msg, rule.p))
116
- failures.push(sendToDebug(node, rule, msg, 20))
117
- }
118
- } else if ( rule.tot == "num") {
119
- if (rule.to == "NaN") {
120
- if ( !isNaN(RED.util.getObjectProperty(msg, rule.p)) ) {
121
- failures.push(sendToDebug(node, rule, msg, 20))
122
- }
123
- } else {
124
- if ( rule.to != RED.util.getObjectProperty(msg,rule.p) ) {
125
- failures.push(sendToDebug(node, rule, msg, 20))
126
- }
127
- }
128
- } else if (rule.tot == "bin") {
129
- let expBuffer = Buffer.from(JSON.parse(rule.to));
130
- let valBuffer = RED.util.getObjectProperty(msg, rule.p);
131
- if ( Buffer.compare( expBuffer, valBuffer) != 0 ) {
114
+ try {
115
+ cfg.rules.forEach(rule => {
116
+ /*
117
+ * Rule is Equal
118
+ */
119
+ if (rule.t == "eql" && rule.pt == "msg") {
120
+ if (rule.tot == "str") {
121
+ if (rule.to != escapeSpecials(RED.util.getObjectProperty(msg, rule.p))) {
122
+ rule._vt = escapeSpecials(RED.util.getObjectProperty(msg, rule.p))
123
+ failures.push(sendToDebug(node, rule, msg, 20))
124
+ }
125
+ } else if (rule.tot == "num") {
126
+ if (rule.to == "NaN") {
127
+ if (!isNaN(RED.util.getObjectProperty(msg, rule.p))) {
132
128
  failures.push(sendToDebug(node, rule, msg, 20))
133
129
  }
134
- } else if (rule.tot == "bool") {
135
- if ( rule.to == "true" && !RED.util.getObjectProperty(msg, rule.p)) {
136
- failures.push(sendToDebug(node, rule, msg, 20))
137
- } else if (rule.to == "false" && !!RED.util.getObjectProperty(msg, rule.p) ) {
130
+ } else {
131
+ if (rule.to != RED.util.getObjectProperty(msg, rule.p)) {
138
132
  failures.push(sendToDebug(node, rule, msg, 20))
139
133
  }
140
- } else if (rule.tot == "jsonata") {
141
- try {
142
- let jsonExpr = RED.util.prepareJSONataExpression(rule.to, node);
143
-
144
- RED.util.evaluateJSONataExpression(jsonExpr, msg, (err, value) => {
145
- if (err) {
146
- rule._err = err
134
+ }
135
+ } else if (rule.tot == "bin") {
136
+ let expBuffer = Buffer.from(JSON.parse(rule.to));
137
+ let valBuffer = RED.util.getObjectProperty(msg, rule.p);
138
+ if (Buffer.compare(expBuffer, valBuffer) != 0) {
139
+ failures.push(sendToDebug(node, rule, msg, 20))
140
+ }
141
+ } else if (rule.tot == "bool") {
142
+ if (rule.to == "true" && !RED.util.getObjectProperty(msg, rule.p)) {
143
+ failures.push(sendToDebug(node, rule, msg, 20))
144
+ } else if (rule.to == "false" && !!RED.util.getObjectProperty(msg, rule.p)) {
145
+ failures.push(sendToDebug(node, rule, msg, 20))
146
+ }
147
+ } else if (rule.tot == "jsonata") {
148
+ try {
149
+ let jsonExpr = RED.util.prepareJSONataExpression(rule.to, node);
150
+
151
+ RED.util.evaluateJSONataExpression(jsonExpr, msg, (err, value) => {
152
+ if (err) {
153
+ rule._err = err
154
+ failures.push(sendToDebug(node, rule, msg, 20))
155
+ } else {
156
+ if (value != escapeSpecials(RED.util.getObjectProperty(msg, rule.p))) {
157
+ rule._vt = escapeSpecials(RED.util.getObjectProperty(msg, rule.p))
147
158
  failures.push(sendToDebug(node, rule, msg, 20))
148
- } else {
149
- if (value != escapeSpecials(RED.util.getObjectProperty(msg, rule.p))) {
150
- rule._vt = escapeSpecials(RED.util.getObjectProperty(msg, rule.p))
151
- failures.push(sendToDebug(node, rule, msg, 20))
152
- }
153
159
  }
154
- });
155
- } catch (e) {
156
- rule._err = e
157
- failures.push(sendToDebug(node, rule, msg, 20))
158
- }
160
+ }
161
+ });
162
+ } catch (e) {
163
+ rule._err = e
164
+ failures.push(sendToDebug(node, rule, msg, 20))
165
+ }
159
166
 
160
- } else if (rule.tot == "json") {
161
- let expObj = JSON.parse(rule.to)
162
- let oldObj = RED.util.getObjectProperty(msg, rule.p)
167
+ } else if (rule.tot == "json") {
168
+ let expObj = JSON.parse(rule.to)
169
+ let oldObj = RED.util.getObjectProperty(msg, rule.p)
163
170
 
164
- // special case: null or undefined
165
- if (!expObj) {
166
- if (oldObj != null && oldObj != undefined) {
171
+ // special case: null or undefined
172
+ if (!expObj) {
173
+ if (oldObj != null && oldObj != undefined) {
174
+ failures.push(sendToDebug(node, rule, msg, 20))
175
+ }
176
+ } else {
177
+ if (Array.isArray(expObj)) {
178
+ if (JSON.stringify(oldObj) != JSON.stringify(expObj)) {
167
179
  failures.push(sendToDebug(node, rule, msg, 20))
168
180
  }
169
181
  } else {
170
- if ( Array.isArray(expObj)) {
171
- if (JSON.stringify(oldObj) != JSON.stringify(expObj)) {
172
- failures.push(sendToDebug(node, rule, msg, 20))
173
- }
174
- } else {
175
- if ( JSON.stringify(oldObj, Object.keys(oldObj).sort()) != JSON.stringify(expObj, Object.keys(expObj).sort()) ) {
176
- failures.push(sendToDebug(node, rule, msg, 20))
177
- }
182
+ if (JSON.stringify(oldObj, Object.keys(oldObj).sort()) != JSON.stringify(expObj, Object.keys(expObj).sort())) {
183
+ failures.push(sendToDebug(node, rule, msg, 20))
178
184
  }
179
185
  }
180
- } else if (rule.tot == "msg") {
181
- if ( RED.util.getObjectProperty(msg,rule.to) != RED.util.getObjectProperty(msg,rule.p) ) {
182
- failures.push(sendToDebug(node, rule, msg, 20))
183
- }
184
- } else {
185
- unsupported.push(postUnsupported(rule,msg))
186
186
  }
187
+ } else if (rule.tot == "msg") {
188
+ if (RED.util.getObjectProperty(msg, rule.to) != RED.util.getObjectProperty(msg, rule.p)) {
189
+ failures.push(sendToDebug(node, rule, msg, 20))
190
+ }
191
+ } else {
192
+ unsupported.push(postUnsupported(rule, msg))
193
+ }
187
194
  /*
188
195
  * Rule is not set on message object
189
196
  */
190
- } else if (rule.t == "notset" && rule.pt == "msg") {
191
- if (RED.util.getObjectProperty(msg, rule.p) !== undefined) {
192
- failures.push(sendToDebug(node, rule, msg, 20))
193
- }
197
+ } else if (rule.t == "notset" && rule.pt == "msg") {
198
+ if (RED.util.getObjectProperty(msg, rule.p) !== undefined) {
199
+ failures.push(sendToDebug(node, rule, msg, 20))
200
+ }
194
201
  /*
195
202
  * Rule is not set on message object
196
203
  */
197
- } else if (rule.t == "set" && rule.pt == "msg") {
198
- if (RED.util.getObjectProperty(msg, rule.p) === undefined) {
199
- failures.push(sendToDebug(node, rule, msg, 20))
200
- }
204
+ } else if (rule.t == "set" && rule.pt == "msg") {
205
+ if (RED.util.getObjectProperty(msg, rule.p) === undefined) {
206
+ failures.push(sendToDebug(node, rule, msg, 20))
207
+ }
201
208
  /*
202
209
  * Rule is match
203
210
  */
204
- } else if ( rule.t == "mth" && rule.pt == "msg") {
205
- if (rule.tot == "str") {
206
- let reExp = new RegExp(rule.to)
207
- if ( !reExp.test(RED.util.getObjectProperty(msg, rule.p)) ) {
208
- failures.push(sendToDebug(node, rule, msg, 20))
209
- }
210
- } else {
211
- unsupported.push(postUnsupported(rule,msg))
211
+ } else if (rule.t == "mth" && rule.pt == "msg") {
212
+ if (rule.tot == "str") {
213
+ let reExp = new RegExp(rule.to)
214
+ if (!reExp.test(RED.util.getObjectProperty(msg, rule.p))) {
215
+ failures.push(sendToDebug(node, rule, msg, 20))
212
216
  }
217
+ } else {
218
+ unsupported.push(postUnsupported(rule, msg))
219
+ }
213
220
  /*
214
221
  * Rule is not equal - both value are msg properties
215
222
  */
216
- } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "msg") {
217
- let expObj = RED.util.getObjectProperty(msg, rule.to)
218
- let oldObj = RED.util.getObjectProperty(msg, rule.p)
219
- if (expObj == oldObj) {
220
- failures.push(sendToDebug(node, rule, msg, 20))
221
- }
223
+ } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "msg") {
224
+ let expObj = RED.util.getObjectProperty(msg, rule.to)
225
+ let oldObj = RED.util.getObjectProperty(msg, rule.p)
226
+ if (expObj == oldObj) {
227
+ failures.push(sendToDebug(node, rule, msg, 20))
228
+ }
222
229
  /*
223
230
  * Rule is not equal - comparing message property to string value
224
231
  */
225
- } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "str") {
226
- let expValue = rule.to
227
- let msgValue = RED.util.getObjectProperty(msg, rule.p)
228
- if (expValue == escapeSpecials(msgValue)) {
229
- rule._vt = escapeSpecials(msgValue)
230
- failures.push(sendToDebug(node, rule, msg, 20))
231
- }
232
+ } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "str") {
233
+ let expValue = rule.to
234
+ let msgValue = RED.util.getObjectProperty(msg, rule.p)
235
+ if (expValue == escapeSpecials(msgValue)) {
236
+ rule._vt = escapeSpecials(msgValue)
237
+ failures.push(sendToDebug(node, rule, msg, 20))
238
+ }
232
239
 
233
240
  /*
234
241
  * Rule is not equal - comparing message property to number value
235
242
  */
236
- } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "num") {
237
- let expValue = rule.to
238
- let msgValue = RED.util.getObjectProperty(msg, rule.p)
239
- if (expValue == msgValue) {
240
- rule._vt = msgValue
241
- failures.push(sendToDebug(node, rule, msg, 20))
242
- }
243
+ } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "num") {
244
+ let expValue = rule.to
245
+ let msgValue = RED.util.getObjectProperty(msg, rule.p)
246
+ if (expValue == msgValue) {
247
+ rule._vt = msgValue
248
+ failures.push(sendToDebug(node, rule, msg, 20))
249
+ }
243
250
 
244
251
  /*
245
- * Other rule types are not supported
252
+ * Rule is not equal - comparing message property to boolean value
246
253
  */
247
- } else {
248
- unsupported.push(postUnsupported(rule,msg))
254
+ } else if (rule.t == "noteql" && rule.pt == "msg" && rule.tot == "bool") {
255
+ let expValue = rule.to == "true"
256
+ let msgValue = RED.util.getObjectProperty(msg, rule.p)
257
+ if (expValue == msgValue) {
258
+ rule._vt = msgValue
259
+ failures.push(sendToDebug(node, rule, msg, 20))
249
260
  }
250
- })
251
261
 
252
- if (node.context().get("succeed") && cfg.ignore_failure_if_succeed) {
253
- node.status({ fill: "green", shape: "ring", text: "assert succeed" })
254
- setTimeout(() => { node.status({}); }, 1000)
262
+ /*
263
+ * Other rule types are not supported
264
+ */
265
+ } else {
266
+ unsupported.push(postUnsupported(rule, msg))
267
+ }
268
+ })
269
+
270
+ if (node.context().get("succeed") && cfg.ignore_failure_if_succeed) {
271
+ node.status({ fill: "green", shape: "ring", text: "assert succeed" })
272
+ setTimeout(() => { node.status({}); }, 1000)
273
+ } else {
274
+ if (failures.length > 0) {
275
+ node.status({ fill: "red", shape: "dot", text: "assert failed" })
276
+ msg.assert_succeed = false
277
+ msg.assert_failures = failures.concat(unsupported)
255
278
  } else {
256
- if (failures.length > 0 ) {
257
- node.status({fill: "red", shape: "dot", text: "assert failed"})
279
+ if (unsupported.length > 0) {
280
+ node.status({ fill: "yellow", shape: "ring", text: "unsupported errors - check debug" })
258
281
  msg.assert_succeed = false
259
282
  msg.assert_failures = failures.concat(unsupported)
260
283
  } else {
261
- if ( unsupported.length > 0) {
262
- node.status({ fill: "yellow", shape: "ring", text: "unsupported errors - check debug" })
263
- msg.assert_succeed = false
264
- msg.assert_failures = failures.concat( unsupported )
265
- } else {
266
- node.context().set("succeed",true)
267
- node.status({ fill: "green", shape: "ring", text: "assert succeed" })
268
- setTimeout(() => { node.status({}); }, 1000)
269
-
270
- msg.assert_succeed = true
271
- delete msg.assert_failures
272
- }
284
+ node.context().set("succeed", true)
285
+ node.status({ fill: "green", shape: "ring", text: "assert succeed" })
286
+ setTimeout(() => { node.status({}); }, 1000)
287
+
288
+ msg.assert_succeed = true
289
+ delete msg.assert_failures
273
290
  }
274
291
  }
275
- send(msg);
276
- done();
277
- } catch ( e ) {
278
- node.status({ fill: "red", shape: "ring", text: "exception see log" })
279
- done()
280
- throw(e) // re-raise so that exception appears in the debug log
281
292
  }
293
+ send(msg);
294
+ done();
295
+ } catch (e) {
296
+ node.status({ fill: "red", shape: "ring", text: "exception see log" })
297
+ done()
298
+ throw (e) // re-raise so that exception appears in the debug log
299
+ }
282
300
  });
283
301
  }
284
302
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/erlang-red-unittest",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "dependencies": {
5
5
  },
6
6
 
@@ -14,9 +14,9 @@
14
14
  let treeListItems = [];
15
15
  let tags = {}
16
16
  let nonTag = []
17
-
17
+
18
18
  Object.keys(resp.data).forEach(function (key) {
19
- let mth = resp.data[key].name.match(/^(\[.+\])/)
19
+ let mth = resp.data[key].name.match(/^\[(.+)\]/)
20
20
  if (mth) {
21
21
  if (tags[mth[0]]) {
22
22
  tags[mth[0]].push(resp.data[key])
@@ -203,9 +203,15 @@ function highlightTestResult(dirList, flowid, status) {
203
203
  clr = "";
204
204
  shp = "fa-minus";
205
205
  break;
206
+ case "not-supported":
207
+ clr = "blue";
208
+ shp = "fa-ban";
209
+ break;
210
+
206
211
  }
207
212
 
208
213
  dirList.treeList('select', `flowid-treelist-${flowid}`);
214
+
209
215
  if ($($(dirList.treeList('selected').treeList.container).find('.red-ui-treeList-icon')).data("status") != status) {
210
216
  $($(dirList.treeList('selected').treeList.container).find('.red-ui-treeList-icon')).data("status", status)
211
217
  $($($(dirList.treeList('selected').treeList.container).find('.red-ui-treeList-icon')).find('i')).prop('class', "fa " + shp).css('color', clr)
@@ -318,7 +324,7 @@ function sendUnittestngHalt() {
318
324
 
319
325
  function resetTestResultsRow() {
320
326
  $('#node-input-unittestingpull-testresults-row').show();
321
- [".todo", ".pending", ".total", ".success",".failed"].forEach( d => {
327
+ [".todo", ".pending", ".total", ".success", ".failed", ".not-supported"].forEach( d => {
322
328
  $('#node-input-unittestingpull-testresults-row').find(d).html("0")
323
329
  })
324
330
  }
@@ -367,8 +373,7 @@ function runAllTests(dirList, withLimit) {
367
373
  }
368
374
 
369
375
  // Add your plugin as a new tabsheet in the right sidebar AFTER the flow editor is completely started
370
- var initialiseConfigNodeOnce = () => {
371
- RED.events.off('runtime-state', initialiseConfigNodeOnce);
376
+ var initSidebarForUnittest = () => {
372
377
 
373
378
  var content = $($('script[type="text/x-red"][data-template-name="UnitTestingSidebar"]').i18n().html());
374
379
 
@@ -385,39 +390,6 @@ RED.sidebar.addTab({
385
390
  visible: true
386
391
  });
387
392
 
388
- /*
389
- var tabs = RED.tabs.create({
390
- id: 'func-unittesting-tabs',
391
- onchange: function (tab) {
392
- $('#func-unittesting-tabs-content').children().hide();
393
- $('#' + tab.id).show();
394
- }
395
- });
396
-
397
- // Add pull tab
398
- tabs.addTab({
399
- id: 'func-unittesting-tab-pull',
400
- iconClass: 'fa fa-arrow-down',
401
- label: 'Tests'
402
- });
403
-
404
- // Add compare tab
405
- tabs.addTab({
406
- id: 'func-unittesting-tab-compare',
407
- iconClass: 'fa fa-clone',
408
- label: 'TBD'
409
- });
410
-
411
- // Add push tab
412
- tabs.addTab({
413
- id: 'func-unittesting-tab-push',
414
- iconClass: 'fa fa-arrow-up',
415
- label: 'TBD'
416
- });
417
-
418
- tabs.activateTab("func-unittesting-tab-pull");
419
- */
420
-
421
393
  $('#func-unittesting-tab-pull').show();
422
394
 
423
395
  var dirList = $("#node-input-unittestingpull-sb-target-container-div").css({
@@ -429,7 +401,7 @@ var dirList = $("#node-input-unittestingpull-sb-target-container-div").css({
429
401
  }
430
402
  ).on('treelistselect', function (event, item) {
431
403
  if ( item.flowid) {
432
- $('#unittesting-view-testflow-link').prop('href', `https://flows.red-erik.org/f/${item.flowid}`)
404
+ $('#unittesting-view-testflow-link').prop('href', `https://github.com/gorenje/erlang-red-flow-testsuite/tree/main/${item.flowid}`)
433
405
  $('#unittesting-view-testflow-link').fadeIn(300)
434
406
  $('#unittesting-helper-import-text').fadeIn(300)
435
407
  } else {
@@ -474,6 +446,10 @@ var search = $("#node-input-unittestingpull-sb-target-filter").searchBox({
474
446
  count = dirList.treeList("filter", function (item) {
475
447
  return !!$($(item.treeList.container).find('.red-ui-treeList-icon')).data("status")
476
448
  });
449
+ } else if (val == "is:not-supported") {
450
+ count = dirList.treeList("filter", function (item) {
451
+ return $($(item.treeList.container).find('.red-ui-treeList-icon')).data("status") == "not-supported"
452
+ });
477
453
  } else {
478
454
  count = dirList.treeList("filter", function (item) {
479
455
  return item.label.toLowerCase().indexOf(val) > -1 || item.sublabel.toLowerCase().indexOf(val) > -1
@@ -554,8 +530,6 @@ let handledStoppedStatus = (data) => {
554
530
  }
555
531
  }
556
532
 
557
- RED.comms.subscribe('unittesting:testresults', handleTestResult);
558
-
559
533
  $('#node-input-unittestingpull-expand-all-but').on('click', function (e) {
560
534
  e.preventDefault();
561
535
  expandAllTests(dirList)
@@ -587,33 +561,6 @@ $('#node-input-unittestingpull-sb-refresh-list-but').on('click', function (e) {
587
561
  }, 150);
588
562
  });
589
563
 
590
- // debugging
591
- window.unitTestDirList = dirList;
592
- window.fakeTestResult = handleTestResult;
593
-
594
- if (RED.comms.on) {
595
- // RED.comms.on is not available on NR 3.x
596
- RED.comms.on("connect", () => {
597
- $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
598
- $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
599
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
600
- });
601
-
602
- RED.comms.on("disconnect", () => {
603
- $('#node-input-unittestingpull-sb-testall-but').prop('disabled', true)
604
- $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', true)
605
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', true)
606
- });
607
-
608
- if ( !RED.comms.isConnected || RED.comms.isConnected() ) {
609
- $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
610
- $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
611
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
612
- }
613
- } else {
614
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
615
- }
616
-
617
564
  RED.actions.add("unittesting:send-halt-to-test-server", sendUnittestngHalt)
618
565
  RED.actions.add("unittesting:test-current-workspace", testCurrentWorkspace)
619
566
  RED.actions.add("unittesting:run-all-tests", () => { runAllTests(dirList) } )
@@ -682,9 +629,43 @@ $('#node-input-unittestingselect-test-node').on('click', (e) => {
682
629
  RED.view.select({ nodes: slNodes.map(n => RED.nodes.node(n)) })
683
630
  }
684
631
  })
632
+
633
+ let inittestunitcomm = () => {
634
+ RED.events.off('flows:loaded', inittestunitcomm);
635
+
636
+ // debugging
637
+ window.unitTestDirList = dirList;
638
+ window.fakeTestResult = handleTestResult;
639
+
640
+ if (RED.comms.on) {
641
+ // RED.comms.on is not available on NR 3.x
642
+ RED.comms.on("connect", () => {
643
+ $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
644
+ $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
645
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
646
+ });
647
+
648
+ RED.comms.on("disconnect", () => {
649
+ $('#node-input-unittestingpull-sb-testall-but').prop('disabled', true)
650
+ $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', true)
651
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', true)
652
+ });
653
+
654
+ if ( !RED.comms.isConnected || RED.comms.isConnected() ) {
655
+ $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
656
+ $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
657
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
658
+ }
659
+ } else {
660
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
661
+ }
662
+
663
+ RED.comms.subscribe('unittesting:testresults', handleTestResult);
664
+ }
665
+ RED.events.on('flows:loaded', inittestunitcomm);
685
666
  };
686
-
687
- RED.events.on('runtime-state', initialiseConfigNodeOnce);
667
+
668
+ RED.plugins.registerPlugin("unittesting-sidebar-plugin", { onadd: initSidebarForUnittest });
688
669
  })();
689
670
  </script>
690
671
 
@@ -729,11 +710,12 @@ $('#node-input-unittestingselect-test-node').on('click', (e) => {
729
710
 
730
711
  <div id="node-input-unittestingpull-testresults-row" class="form-row"
731
712
  style="margin-left: 10px; margin-top: 15px; display: none;">
732
- <span class='filtrg'data-filter="todo">Todo <span class="todo" style="color: purple">0</span></span>
733
- / <span class='filtrg'data-filter="succeed">Succeed <span class="success" style="color: green">0</span></span>
734
- / <span class='filtrg'data-filter="pending">Pending <span class="pending" style="color: orange">0</span></span>
735
- / <span class='filtrg'data-filter="failed">Failed <span class="failed" style="color: red">0</span></span>
736
- / <span class='filtrg'data-filter="tested">Done <span class='total'>0</span></span>
713
+ <span class='filtrg' data-filter="todo">Todo <span class="todo" style="color: purple">0</span></span>
714
+ / <span class='filtrg' data-filter="succeed">Succeed <span class="success" style="color: green">0</span></span>
715
+ / <span class='filtrg' data-filter="pending">Pending <span class="pending" style="color: orange">0</span></span>
716
+ / <span class='filtrg' data-filter="failed">Failed <span class="failed" style="color: red">0</span></span>
717
+ / <span class='filtrg' data-filter="not-supported">Not Supported <span class="not-supported" style="color: blue">0</span></span>
718
+ / <span class='filtrg' data-filter="tested">Done <span class='total'>0</span></span>
737
719
  </div>
738
720
 
739
721
  <div class="form-row" style="margin-left: 10px; margin-top: 30px;">