Handle context.get with multiple levels of unknown key

Fixes #1883
This commit is contained in:
Nick O'Leary
2018-09-09 23:47:31 +01:00
parent 0f4d46671f
commit fc0cf1ff51
5 changed files with 50 additions and 20 deletions

View File

@@ -672,7 +672,7 @@ describe('localfilesystem',function() {
it('should enumerate context keys in the cache',function() {
var globalData = {foo:"bar"};
fs.outputFile(path.join(resourcesDir,defaultContextBase,"global","global.json"), JSON.stringify(globalData,null,4), "utf8").then(function(){
return fs.outputFile(path.join(resourcesDir,defaultContextBase,"global","global.json"), JSON.stringify(globalData,null,4), "utf8").then(function(){
context = LocalFileSystem({dir: resourcesDir, cache: true, flushInterval: 2});
return context.open()
}).then(function(){

View File

@@ -96,7 +96,7 @@ describe('memory',function() {
context.set("nodeX","three","test3");
context.set("nodeX","four","test4");
var values = context.get("nodeX",["one","unknown"]);
var values = context.get("nodeX",["one","unknown.with.multiple.levels"]);
values.should.eql(["test1",undefined])
})
it('should throw error if bad key included in multiple keys', function() {