Skip to content

Commit fa215a4

Browse files
AdrieanKhisbemhamann
authored andcommitted
add tests for the normal configuration of yargs via argv
1 parent 802a8d6 commit fa215a4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/stores/argv-test.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ vows.describe('nconf/stores/argv').addBatch({
2121
"can be created with a custom yargs":{
2222
topic: function(){
2323
var yargsInstance = yargs.alias('v', 'verbose').default('v', 'false');
24-
console.log(yargsInstance)
2524
return [yargsInstance, new nconf.Argv(yargsInstance)];
2625
},
2726
"and can give access to them": function (argv) {
@@ -35,6 +34,20 @@ vows.describe('nconf/stores/argv').addBatch({
3534
assert.equal(argv.get('verbose'), 'false');
3635
assert.equal(argv.get('v'), 'false');
3736
}
37+
},
38+
"can be created with a nconf yargs":{
39+
topic: function(){
40+
var options = {verbose: {alias: 'v', default: 'false'}};
41+
return new nconf.Argv(options);
42+
},
43+
"and can give access to them": function (argv) {
44+
assert.deepEqual(argv.options, {verbose: {alias: 'v', default: 'false'}})
45+
},
46+
"values are the one from the custom yargv": function (argv) {
47+
argv.loadSync()
48+
assert.equal(argv.get('verbose'), 'false');
49+
assert.equal(argv.get('v'), 'false');
50+
}
3851
}
3952
}
4053
}).export(module);

0 commit comments

Comments
 (0)