Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/nconf/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Provider.prototype.add = function (name, options, usage) {
// this was used in the call to `.add()`.
//
Provider.prototype.remove = function (name) {
delete this.stores[name];
this.stores[name] = null;
return this;
};

Expand Down
10 changes: 9 additions & 1 deletion test/provider-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ vows.describe('nconf/provider').addBatch({
"when 'env' is set to true with a nested separator": helpers.assertSystemConf({
script: path.join(fixturesDir, 'scripts', 'nconf-nested-env.js'),
env: { SOME_THING: 'foobar' }
})
}),
"calling the use() method after adding other stores": {
topic: new nconf.Provider().use('file', { file: files[0] }).defaults({candy: {something: 'should never get this'}}),
"should use a new instance of the store type": function (provider) {
provider.use('file', { file: files[1] });

assert.equal(provider.get('candy:something'), 'file2');
}
},
}
}
}).addBatch({
Expand Down