# ❓ Discussion: How do you test your flows?

**URL:** <https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061>\
**Category:** General\
**Created:** [8 January 2020 15:24 UTC](https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061 "2020-01-08T15:24:51Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 January 2020 17:10 UTC](https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061/21 "2020-01-17T17:10:11Z")

</div>

Actually, you reminded me that there is an assert node. In fact 2:

[https://flows.nodered.org/search?term=assert](https://flows.nodered.org/search?term=assert)

---

<div class="post-metadata">

**Author:** ![gmag11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gmag11/32/477_2.png) [@gmag11](https://discourse.nodered.org/u/gmag11)\
**Post date:** [20 January 2020 17:34 UTC](https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061/22 "2020-01-20T17:34:55Z")

</div>

I use inject nodes with different test messages an debug node to check output. I know it's not a real test.  
I did not know about assert node. I'll have a look.  
Anyway, it would very nice to get some indications on best practises to do testing on NodeRed.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [4 February 2020 21:13 UTC](https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061/23 "2020-02-04T21:13:10Z")

</div>

> [@knolleary](#):
>
> Have you create tests within Node-RED itself that you can run, and if so, how?

Hi Nick,  
a bit late to the party. Unfortunately I _ **don't** _ have a test suite _outside_ my flow (like e.g. in [noflo](https://noflojs.org/documentation/testing/)) but I _ **do** _ have some tests inside my flow.

- With my node-red-contrib-msg-speed node I test whether the messages arrive at the expected _ **speed** _ (within limits). E.g. for image streams from IP camera's...
- With my node-red-contrib-interval-length node I test whether the _ **time interval** _ between successive messages isn't too big. When no message arrives within a specified time interval, a timeout message will be generated... E.g. to make sure that I have periodically measurements from my sensors.
- With switch nodes I test whether the values in the messages have expected _ **values** _.

Of course these are end-to-end tests. E.g. when my IP camera fails, the test will fail although my flow might be correct. So I'm not mocking the camera by an oscillator node, for checking the flow only...

And a disadvantage is that these 'test" nodes pollute my real flow a bit ...  
Bart

---

<div class="post-metadata">

**Author:** ![thenorthpalm](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@thenorthpalm](https://discourse.nodered.org/u/thenorthpalm)\
**Post date:** [5 March 2023 21:04 UTC](https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061/24 "2023-03-05T21:04:23Z")

</div>

Having a test suite for your flows is a great idea. It helps you catch any issues early and ensures everything works smoothly. I have yet to create tests outside of Node-RED, but I've used the built-in testing functionality. I'd love to hear more about how people are testing their flows and what tools they're using. Have you heard of ZapTest [https://www.zaptest.com/api-testing-automation](https://www.zaptest.com/api-testing-automation)? It's a free API testing automation tool worth checking out. Thanks for starting this discussion. I'm looking forward to learning more!

[Previous page](https://discourse.nodered.org/t/discussion-how-do-you-test-your-flows/20061.md?page=1)
