-
Notifications
You must be signed in to change notification settings - Fork 10
/
test.js
79 lines (58 loc) · 1.58 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import childProcess from 'child_process';
import test from 'ava';
test.cb('small', t => {
const cp = childProcess.spawn('./cli.js', ['-s', '9gag'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});
test.cb('medium', t => {
const cp = childProcess.spawn('./cli.js', ['-m', '9gag'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});
test.cb('regular', t => {
const cp = childProcess.spawn('./cli.js', ['-r', 'iama_rishi'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});
test.cb('large', t => {
const cp = childProcess.spawn('./cli.js', ['-f', '9gag'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});
test.cb('image', t => {
const cp = childProcess.spawn('./cli.js', ['-l', 'https://www.instagram.com/p/BgiF0PsD1qx/?taken-by=iama_rishi'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});
test.cb('video', t => {
const cp = childProcess.spawn('./cli.js', ['-v', 'https://www.instagram.com/p/BeTABLeFnxW/?taken-by=iama_rishi'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});
test.cb('all', t => {
const cp = childProcess.spawn('./cli.js', ['-a', 'https://www.instagram.com/p/BoLZlVSFmR1/?taken-by=9gag'], {stdio: 'inherit'});
cp.on('error', t.ifError);
cp.on('close', code => {
t.is(code, 0);
t.end();
});
});