Merge pull request #1850 from node-red-hitachi/without-callback

Allow `get` and `keys` to be called without callback
This commit is contained in:
Nick O'Leary
2018-07-28 22:08:36 +01:00
committed by GitHub
3 changed files with 131 additions and 60 deletions

View File

@@ -793,15 +793,13 @@ describe('context', function() {
});
});
it('should throw an error if callback of context.get is not specified', function (done) {
it('should not throw an error if callback of context.get is not specified', function (done) {
Context.init({ contextStorage: memoryStorage });
Context.load().then(function () {
var context = Context.get("1", "flow");
context.get("foo", "memory");
done("should throw an error.");
}).catch(function () {
done();
});
}).catch(done);
});
it('should throw an error if callback of context.set is not a function', function (done) {
@@ -835,15 +833,13 @@ describe('context', function() {
});
});
it('should throw an error if callback of context.keys is not specified', function (done) {
it('should not throw an error if callback of context.keys is not specified', function (done) {
Context.init({ contextStorage: memoryStorage });
Context.load().then(function () {
var context = Context.get("1", "flow");
context.keys("memory");
done("should throw an error.");
}).catch(function () {
done();
});
}).catch(done);
});
});