How to use the node-red-node-test-helper.load function in node-red-node-test-helper

To help you get started, we’ve selected a few node-red-node-test-helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-red / node-red / test / nodes / core / common / 60-link_spec.js View on Github external
it('should be loaded (link in)', function(done) {
        var flow = [{id:"n1", type:"link in", name: "link-in" }];
        helper.load(linkNode, flow, function() {
            var n1 = helper.getNode("n1");
            n1.should.have.property('name', 'link-in');
            done();
        });
    });
github node-red / node-red / test / nodes / core / parsers / 70-HTML_spec.js View on Github external
it('should be loaded', function(done) {
        var flow = [{id:"htmlNode1", type:"html", name: "htmlNode" }];
        helper.load(htmlNode, flow, function() {
            var htmlNode1 = helper.getNode("htmlNode1");
            htmlNode1.should.have.property('name', 'htmlNode');
            done();
        });
    });
github node-red / node-red / test / nodes / core / function / 90-exec_spec.js View on Github external
it('should be loaded with any defaults', function(done) {
        var flow = [{id:"n1", type:"exec", name: "exec1"}];
        helper.load(execNode, flow, function() {
            var n1 = helper.getNode("n1");
            n1.should.have.property("name", "exec1");
            n1.should.have.property("cmd", "");
            n1.should.have.property("append", "");
            n1.should.have.property("addpay",true);
            n1.should.have.property("timer",0);
            n1.should.have.property("oldrc","false");
            done();
        });
    });
github node-red / node-red / test / nodes / core / common / 98-unknown_spec.js View on Github external
it('should be loaded', function(done) {
        var flow = [{id:"n1", type:"unknown", name: "unknown" }];
        helper.load(unknown, flow, function() {
            var n1 = helper.getNode("n1");
            n1.should.have.property('name', 'unknown');
            done();
        });
    });
github node-red / node-red / test / nodes / core / sequence / 19-batch_spec.js View on Github external
function check_interval(flow, results, delay, done) {
        helper.load(batchNode, flow, function() {
            var n1 = helper.getNode("n1");
            var n2 = helper.getNode("n2");
            check_data(n1, n2, results, done);
            delayed_send(n1, 0, 4, delay);
        });
    }

node-red-node-test-helper

A test framework for Node-RED nodes

Apache-2.0
Latest version published 6 months ago

Package Health Score

74 / 100
Full package analysis