How to properly test node-red nodes?
Asked Answered
P

1

8

I'm developing a node-red node, and I'd like to know the best or intended way to test those nodes. I've been looking at some other nodes, and they look to depend on a peer installation of node-red itself and use the "helper.js" to load those nodes. I was expecting to have a more "unit-level" testing perhaps mocking the node-red.

Pietje answered 5/7, 2016 at 15:10 Comment(2)
You'll do much better asking this on the Node-RED mailing list (groups.google.com/forum/#!forum/node-red) than here.Submicroscopic
The debug node in the node red help you to test your functionality and data at each node.please check with nodeInculpable
R
1

If you look at the way that the core nodes are tested, this should give you some ideas.

There is also an effort underway to extract the test harness from core and make it available for everyone. You should also check out the Node-RED WIKI which contains some information on testing.

In general, it looks like you will need to run your node in an embedded version of Node-RED. Running NR using your chosen test tool.

Rakeoff answered 26/2, 2018 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.