-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
61 lines (49 loc) · 1017 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
49
50
51
52
53
54
55
56
57
58
59
60
61
const SP = require('./index'), { exec: e } = require('child_process');
const wt = `node -e "for (let i = 0; i < 5e6; i++) {console.log()}"`
const Ora = require('ora');
const spinner = Ora({
text: 'Test #3',
spinner: SP.slidingDots.seven2
});
const s = t => {
spinner.stopAndPersist({
text: t,
symbol: SP.succeed('slidingDots.seven2')
})
}
const f = t => {
spinner.stopAndPersist({
text: t,
symbol: SP.fail('slidingDots.seven2')
})
}
const w = t => {
spinner.stopAndPersist({
text: t,
symbol: SP.warn('slidingDots.seven2')
})
}
const i = t => {
spinner.stopAndPersist({
text: t,
symbol: SP.info('slidingDots.seven2')
})
}
console.log(`Test #1 ${SP.slidingDots.seven2.frames}`);
console.log(`Test #2 ${SP.succeed('slidingDots.seven2')}`);
spinner.start();
s();
spinner.start();
f();
spinner.start();
w();
spinner.start();
i();
spinner.text = 'Test #4';
spinner.start();
e(wt, () => {
// if (e) throw e;
spinner.stopAndPersist({
symbol: SP.succeed('slidingDots.seven2')
});
});