1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add test case

This commit is contained in:
HirokiUchikawa 2018-05-31 09:47:21 +09:00
parent c48c74f173
commit 16715673c3

View File

@ -142,6 +142,16 @@ describe('context', function() {
keys[1].should.eql("abc");
});
it('should enumerate only context keys when GlobalContext was given', function() {
Context.init({functionGlobalContext: {foo:"bar"}});
return Context.load().then(function(){
var context = Context.get("1","flowA");
var keys = context.global.keys("global");
keys.should.have.length(1);
keys[0].should.eql("foo");
});
});
it('should store data on memory when contextStorage is not defined', function() {
var context = Context.get("1","flow");
context.set("#nonexist.key1", "val1");