# Unit testing configuration node

**URL:** https://discourse.nodered.org/t/unit-testing-configuration-node/74360
**Category:** Developing Nodes
**Created:** [29 January 2023 16:04 UTC](https://discourse.nodered.org/t/unit-testing-configuration-node/74360 "2023-01-29T16:04:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![donatelloraphael](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/donatelloraphael/32/75218_2.png) [@donatelloraphael](https://discourse.nodered.org/u/donatelloraphael)
#### Post date: [29 January 2023 16:04 UTC](https://discourse.nodered.org/t/unit-testing-configuration-node/74360/1 "2023-01-29T16:04:38Z")

</div>

Is it possible to unit test config nodes in isolation? If so, how do I go about doing it?

---

<div class="post-metadata">

### Author: ![dudest](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dudest/32/72328_2.png) [@dudest](https://discourse.nodered.org/u/dudest)
#### Post date: [10 February 2023 00:47 UTC](https://discourse.nodered.org/t/unit-testing-configuration-node/74360/2 "2023-02-10T00:47:02Z")

</div>

I am also interested in this. What I've tried so far was not successful.

1. I manually tested that I can create and connect to a remote host with the config node so I know it works.
2. I then tried to write a unit test that proves that the config node is loaded by checking that one of it's properties exists.
3. The test failed.

```auto
    it('should be loaded', (done) => {
        var flow = [{ id: "n1", type: "qsys-core", host: "127.0.0.1" }];
        helper.load(qsysCore, flow, () => {
            var n1 = helper.getNode("n1");
            try {
                n1.should.have.property('host', '127.0.0.1');
                done();
            } catch (err) {
                done(err);
            }
        });
    });

```

**Caveat:** There are surely people with more experience with this sort of thing than I on the forum. My failed unit test may be the result of some silly typo or missed declaration that I haven't yet tracked down.

---

<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: [11 April 2023 00:47 UTC](https://discourse.nodered.org/t/unit-testing-configuration-node/74360/3 "2023-04-11T00:47:34Z")

</div>

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