Skip to content

Commit

Permalink
add tests for the normal configuration of yargs via argv
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrieanKhisbe authored and mhamann committed Oct 28, 2017
1 parent 802a8d6 commit fa215a4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/stores/argv-test.js
Expand Up @@ -21,7 +21,6 @@ vows.describe('nconf/stores/argv').addBatch({
"can be created with a custom yargs":{
topic: function(){
var yargsInstance = yargs.alias('v', 'verbose').default('v', 'false');
console.log(yargsInstance)
return [yargsInstance, new nconf.Argv(yargsInstance)];
},
"and can give access to them": function (argv) {
Expand All @@ -35,6 +34,20 @@ vows.describe('nconf/stores/argv').addBatch({
assert.equal(argv.get('verbose'), '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);

0 comments on commit fa215a4

Please sign in to comment.