mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
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:
commit
774e4bfced
@ -36,6 +36,9 @@ describe('template node', function() {
|
|||||||
function initContext(done) {
|
function initContext(done) {
|
||||||
Context.init({
|
Context.init({
|
||||||
contextStorage: {
|
contextStorage: {
|
||||||
|
memory0: { // do not use (for excluding effect fallback)
|
||||||
|
module: "memory"
|
||||||
|
},
|
||||||
memory1: {
|
memory1: {
|
||||||
module: "memory"
|
module: "memory"
|
||||||
},
|
},
|
||||||
@ -337,7 +340,7 @@ describe('template node', function() {
|
|||||||
msg.should.have.property('topic', 'bar');
|
msg.should.have.property('topic', 'bar');
|
||||||
msg.should.have.property('payload', 'foo');
|
msg.should.have.property('payload', 'foo');
|
||||||
// result is in flow context
|
// 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");
|
val.should.equal("payload=foo");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@ -375,7 +378,7 @@ describe('template node', function() {
|
|||||||
msg.should.have.property('topic', 'bar');
|
msg.should.have.property('topic', 'bar');
|
||||||
msg.should.have.property('payload', 'foo');
|
msg.should.have.property('payload', 'foo');
|
||||||
// result is in global context
|
// 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");
|
val.should.equal("payload=foo");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user