Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
588 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var parse = require('../');
|
---|
| 2 | var test = require('tape');
|
---|
| 3 |
|
---|
| 4 | test('dotted alias', function (t) {
|
---|
| 5 | var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
|
---|
| 6 | t.equal(argv.a.b, 22);
|
---|
| 7 | t.equal(argv.aa.bb, 22);
|
---|
| 8 | t.end();
|
---|
| 9 | });
|
---|
| 10 |
|
---|
| 11 | test('dotted default', function (t) {
|
---|
| 12 | var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
|
---|
| 13 | t.equal(argv.a.b, 11);
|
---|
| 14 | t.equal(argv.aa.bb, 11);
|
---|
| 15 | t.end();
|
---|
| 16 | });
|
---|
| 17 |
|
---|
| 18 | test('dotted default with no alias', function (t) {
|
---|
| 19 | var argv = parse('', {default: {'a.b': 11}});
|
---|
| 20 | t.equal(argv.a.b, 11);
|
---|
| 21 | t.end();
|
---|
| 22 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.