node-red / node-red-node-test-helper

A test framework for Node-RED nodes
Apache License 2.0
57 stars 41 forks source link

credentials is undefined #47

Closed enorfelt closed 4 years ago

enorfelt commented 4 years ago

How do I use testCredentials?

I supply credentials like this in my test:

var credentials = { userid: "username", apikey: "password", }; helper.load(bfApiReq, flow, credentials, function () {

Then in my node this.credentials.userid is undefined.

enorfelt commented 4 years ago

I think I figured it out. You have do define witch flow the credentials belong to. Like this:

var credentials = {
      n1: {
        userid: "username",
        apikey: "password",
      },
    };
javis86 commented 2 years ago

This needs to be in docs!