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