fixing the tests
This commit is contained in:
parent
8105c761ad
commit
f69e43a423
3 changed files with 14 additions and 11 deletions
3
test/fixtures/hierarchy/user.json
vendored
3
test/fixtures/hierarchy/user.json
vendored
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"title": "My specific title",
|
"title": "My specific title",
|
||||||
"color": "green"
|
"color": "green",
|
||||||
|
"weebls": "crap"
|
||||||
}
|
}
|
|
@ -20,8 +20,8 @@ vows.describe('nconf/hierarchy').addBatch({
|
||||||
"When using nconf": {
|
"When using nconf": {
|
||||||
"configured with two file stores": {
|
"configured with two file stores": {
|
||||||
topic: function () {
|
topic: function () {
|
||||||
nconf.add('user', { type: 'file', file: userConfig });
|
|
||||||
nconf.add('global', { type: 'file', file: globalConfig });
|
nconf.add('global', { type: 'file', file: globalConfig });
|
||||||
|
nconf.add('user', { type: 'file', file: userConfig });
|
||||||
nconf.load();
|
nconf.load();
|
||||||
return nconf;
|
return nconf;
|
||||||
},
|
},
|
||||||
|
@ -98,12 +98,12 @@ vows.describe('nconf/hierarchy').addBatch({
|
||||||
assert.deepEqual(JSON.parse(data), {
|
assert.deepEqual(JSON.parse(data), {
|
||||||
apples: true,
|
apples: true,
|
||||||
candy: {
|
candy: {
|
||||||
something: 'foo',
|
something: 'file1',
|
||||||
something1: true,
|
something1: true,
|
||||||
something2: true,
|
something2: true,
|
||||||
something5: {
|
something5: {
|
||||||
first: 1,
|
first: 1,
|
||||||
second: 'bar'
|
second: 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,22 +107,24 @@ vows.describe('nconf').addBatch({
|
||||||
"without a callback": {
|
"without a callback": {
|
||||||
"should respond with the merged store": function () {
|
"should respond with the merged store": function () {
|
||||||
assert.deepEqual(nconf.load(), {
|
assert.deepEqual(nconf.load(), {
|
||||||
title: 'My specific title',
|
title: 'My generic title',
|
||||||
color: 'green',
|
color: 'red',
|
||||||
movie: 'Kill Bill'
|
weebls: 'crap',
|
||||||
|
movie: 'Kill Bill'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"with a callback": {
|
"with a callback": {
|
||||||
topic: function () {
|
topic: function () {
|
||||||
nconf.load(this.callback.bind(null, null));
|
nconf.load(this.callback.bind(null, null));
|
||||||
},
|
},
|
||||||
"should respond with the merged store": function (ign, err, store) {
|
"should respond with the merged store": function (ign, err, store) {
|
||||||
assert.isNull(err);
|
assert.isNull(err);
|
||||||
assert.deepEqual(store, {
|
assert.deepEqual(store, {
|
||||||
title: 'My specific title',
|
title: 'My generic title',
|
||||||
color: 'green',
|
color: 'red',
|
||||||
movie: 'Kill Bill'
|
weebls: 'crap',
|
||||||
|
movie: 'Kill Bill'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue