test retrieving non-existent keys and drilling into non-objects
This commit is contained in:
parent
6acc1fc533
commit
8a79ef04fd
1 changed files with 10 additions and 0 deletions
|
@ -28,6 +28,16 @@ vows.describe('nconf/stores/memory').addBatch({
|
|||
assert.equal(store.get('falsy:string'), '');
|
||||
assert.equal(store.get('falsy:boolean'), false);
|
||||
assert.equal(store.get('falsy:object'), null);
|
||||
},
|
||||
"should not fail when retrieving non-existent keys": function (store) {
|
||||
assert.doesNotThrow(function() {
|
||||
assert.equal(store.get('this:key:does:not:exist'), undefined);
|
||||
}, TypeError);
|
||||
},
|
||||
"should not fail when drilling into non-objects": function (store) {
|
||||
assert.doesNotThrow(function() {
|
||||
assert.equal(store.get('falsy:number:uh:oh'), undefined);
|
||||
}, TypeError);
|
||||
}
|
||||
},
|
||||
"the clear() method": {
|
||||
|
|
Loading…
Reference in a new issue