-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
48 lines (45 loc) · 916 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const test = require('tape');
const app = require('./index');
test('merge', function(t) {
t.deepEqual(app.merge({
'hello': 'world'
}, {
'run': 'magnet'
}), {
'hello': 'world',
'run': 'magnet'
});
t.end();
});
test('assign', function(t) {
var k = ['hey'];
var l = ['hey-bro'];
t.deepEqual(app.assign(k), {
'hey': 'hey'
});
t.deepEqual(app.assign(l), {
'hey_bro': 'hey-bro'
});
t.end();
});
test('getopts', function(t) {
t.deepEqual(app.getopts({
'nuts': 'therapy',
'junk': 'avalance',
'white': 'teeth'
}, ['junk']), {
'nuts': 'therapy',
'white': 'teeth'
});
t.deepEqual(app.getopts({
'nuts': 'therapy',
'_': ['avalance', 'needs', 'business'],
'junk': ['avalance', 'needs', 'business'],
'boy': 'expulsion',
'white': 'teeth'
}, ['junk', '_', 'boy']), {
'nuts': 'therapy',
'white': 'teeth'
});
t.end();
});