# Which Node-RED version starts to support node unittest?

**URL:** <https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024>\
**Category:** Developing Nodes\
**Tags:** function-node\
**Created:** [11 December 2022 11:11 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024 "2022-12-11T11:11:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [11 December 2022 11:11 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/1 "2022-12-11T11:11:28Z")

</div>

I checked the github doc of [node-red-node-test-helper](https://github.com/node-red/node-red-node-test-helper). It doesn't say directly, but leaves a number in the `package.json`:

```json
  "devDependencies": {
    "node-red":"^0.18.4",
    "node-red-node-test-helper": "^0.1.8"
  }

```

Just want to confirm with people whether or not `0.18.4` is the answer.  
Thanks!

---

<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:** [11 December 2022 12:37 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/2 "2022-12-11T12:37:03Z")

</div>

I think it should have a `node-red` section in the package.json that should say the minimum supported version?

@Steve-Mcl, is that something that should be added to the package?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 December 2022 12:40 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/3 "2022-12-11T12:40:02Z")

</div>

I think the question is more when did node-red start supporting test-helper.

If I am correct then installing node-red-test-helper@0.1.2 will allow the OP to run tests on a node designed for node-red v0.18.3 or later (see [here](https://github.com/node-red/node-red-node-test-helper/blob/27e290346856d897ead40fb7e596369bf2bbd86b/package.json#L16))

---

<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:** [11 December 2022 12:42 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/4 "2022-12-11T12:42:51Z")

</div>

But that info should also go in the package.json file right?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 December 2022 12:50 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/5 "2022-12-11T12:50:04Z")

</div>

Not 100% certain what you are asking Julian?

If you mean a custom nodes `package.json` then yes, there should be a `node-red` section (but it is not mandatory, just recommended & good authorship & scored against)

If you mean the `node-red-node-test-helper`s package should have a `node-red` section, then I am not certain it does since it is typically included as a dev dependency alongside the min supported node-red version in your custom node (see the [readme](https://github.com/node-red/node-red-node-test-helper#adding-to-your-node-project-dependencies))

Maybe Nick can answer that.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 December 2022 12:52 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/6 "2022-12-11T12:52:25Z")

</div>

Correct. The test helper module isnt a Node-RED module that gets loaded by the runtime that requires the `node-red` section in package.json.

---

<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:** [11 December 2022 13:41 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/7 "2022-12-11T13:41:49Z")

</div>

OK, but it would seem sensible to have a minimum node-red version listed somewhere? Unless there really isn't a minimum, in which case, it might be sensible to say so in the docs?

---

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [12 December 2022 04:24 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/8 "2022-12-12T04:24:20Z")

</div>

You are right.  
My concerns

- There are explicit Node-RED version numbers in [the Getting Started doc](https://nodered.org/docs/getting-started/local): 1.1.0 and 1.3.5 in two sections as of today.
- This leaves an impression that one of those versions should be the go-to version for beginners, although they might be random situational examples (?).
- For this reason, our internal NR had been locked onto a recommended version by that page for a long time.
- When I was following the test-helper node's tutorial, I forgot to link `node-red` executable, which brought me up all the way to 3.0.2. So I was a bit confused and was wondering if NR 3.x was required.

I just wanted to confirm that we can stay with a version older than 3.x, say 2.0.5, and introduce the test-helper node to our codebase at the same time.

Thanks, guys!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [12 December 2022 07:49 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/9 "2022-12-12T07:49:47Z")

</div>

> [@kakyoism](#):
>
> - There are explicit Node-RED version numbers in [the Getting Started doc](https://nodered.org/docs/getting-started/local): 1.1.0 and 1.3.5 in two sections as of today.
> - This leaves an impression that one of those versions should be the go-to version for beginners, although they might be random situational examples (?).

You are right, they are just example numbers from the time those docs were written.

Node-RED 1.x is no longer maintained and does not receive any fixes.

Node-RED 2.x is in maintenance mode and will receive occasional releases with backported fixes.

The main release stream is Node-RED 3.x

This is documented here [Release Plan : Node-RED](https://nodered.org/about/releases/)

---

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [12 December 2022 07:57 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/10 "2022-12-12T07:57:37Z")

</div>

This is super useful, Nick!  
From the page you linked, where can I find the records of breaking changes?

- Can I understand that the major versions all introduce some breaking changes? e.g., 4.x will break some part of 3.x?

Where can I find the comprehensive list of those changes?

- I quickly scanned through [NR's github releases section](https://github.com/node-red/node-red/releases), but can't see the obvious breaking changes from a glimpse in e.g., 3.0.0.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 December 2022 08:06 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/11 "2022-12-12T08:06:26Z")

</div>

The main breakage was dropping support for node 12 and earlier. That meant that users had to also update nodejs. And then recompile any nodes that had binary bindings etc. any other breakage would be noted in the release notes.

---

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [12 December 2022 08:27 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/12 "2022-12-12T08:27:17Z")

</div>

Thanks @dceejay  
When you say

> any other breakage would be noted in the release notes.

Do you mean it'll be a dedicated section like the ones I see in the typical release nodes of NR:

- Editor
- Runtime
- Nodes

like this

- "Breaking Changes"

Or should I really dig into the individual items?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [12 December 2022 08:42 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/13 "2022-12-12T08:42:30Z")

</div>

The release blog posts will highlight any significant breaking changes.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [12 December 2022 08:48 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/14 "2022-12-12T08:48:41Z")

</div>

To clarify, the only releases that _might_ contain breaking changes will be 2.0.0 and 3.0.0

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 December 2022 08:49 UTC](https://discourse.nodered.org/t/which-node-red-version-starts-to-support-node-unittest/72024/15 "2022-12-26T08:49:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
