Merge pull request #1819 from node-red-hitachi/fix-template-node-test

Fix test for template node for persistable context
This commit is contained in:
Nick O'Leary 2018-07-20 11:41:41 +01:00 committed by GitHub
commit 774e4bfced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -36,6 +36,9 @@ describe('template node', function() {
function initContext(done) {
Context.init({
contextStorage: {
memory0: { // do not use (for excluding effect fallback)
module: "memory"
},
memory1: {
module: "memory"
},
@ -337,7 +340,7 @@ describe('template node', function() {
msg.should.have.property('topic', 'bar');
msg.should.have.property('payload', 'foo');
// result is in flow context
n2.context().flow.get("payload", "memory", function (err, val) {
n2.context().flow.get("payload", "memory1", function (err, val) {
val.should.equal("payload=foo");
done();
});
@ -375,7 +378,7 @@ describe('template node', function() {
msg.should.have.property('topic', 'bar');
msg.should.have.property('payload', 'foo');
// result is in global context
n2.context().global.get("payload", "memory", function (err, val) {
n2.context().global.get("payload", "memory1", function (err, val) {
val.should.equal("payload=foo");
done();
});