add tests for the normal configuration of yargs via argv
This commit is contained in:
parent
802a8d623f
commit
fa215a44f1
1 changed files with 14 additions and 1 deletions
|
@ -21,7 +21,6 @@ vows.describe('nconf/stores/argv').addBatch({
|
||||||
"can be created with a custom yargs":{
|
"can be created with a custom yargs":{
|
||||||
topic: function(){
|
topic: function(){
|
||||||
var yargsInstance = yargs.alias('v', 'verbose').default('v', 'false');
|
var yargsInstance = yargs.alias('v', 'verbose').default('v', 'false');
|
||||||
console.log(yargsInstance)
|
|
||||||
return [yargsInstance, new nconf.Argv(yargsInstance)];
|
return [yargsInstance, new nconf.Argv(yargsInstance)];
|
||||||
},
|
},
|
||||||
"and can give access to them": function (argv) {
|
"and can give access to them": function (argv) {
|
||||||
|
@ -35,6 +34,20 @@ vows.describe('nconf/stores/argv').addBatch({
|
||||||
assert.equal(argv.get('verbose'), 'false');
|
assert.equal(argv.get('verbose'), 'false');
|
||||||
assert.equal(argv.get('v'), 'false');
|
assert.equal(argv.get('v'), 'false');
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"can be created with a nconf yargs":{
|
||||||
|
topic: function(){
|
||||||
|
var options = {verbose: {alias: 'v', default: 'false'}};
|
||||||
|
return new nconf.Argv(options);
|
||||||
|
},
|
||||||
|
"and can give access to them": function (argv) {
|
||||||
|
assert.deepEqual(argv.options, {verbose: {alias: 'v', default: 'false'}})
|
||||||
|
},
|
||||||
|
"values are the one from the custom yargv": function (argv) {
|
||||||
|
argv.loadSync()
|
||||||
|
assert.equal(argv.get('verbose'), 'false');
|
||||||
|
assert.equal(argv.get('v'), 'false');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).export(module);
|
}).export(module);
|
Loading…
Reference in a new issue