Merge pull request #1827 from node-red-hitachi/context-test-localfile

Add test cases for localfilesystem context
This commit is contained in:
Nick O'Leary
2018-07-20 11:44:39 +01:00
committed by GitHub
2 changed files with 232 additions and 0 deletions

View File

@@ -203,6 +203,8 @@ LocalFileSystem.prototype.set = function(scope, key, value, callback) {
var storagePath = getStoragePath(this.storageBaseDir ,scope);
fs.outputFile(storagePath + ".json", JSON.stringify(newContext, undefined, 4), "utf8").catch(function(err) {
});
} else if (callback && typeof callback !== 'function') {
throw new Error("Callback must be a function");
} else {
this._set(scope,key,value,callback);
}