-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
34 lines (26 loc) · 758 Bytes
/
test.js
File metadata and controls
34 lines (26 loc) · 758 Bytes
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
const chalk = require('chalk')
const SimpleProgressBar = require('./index')
/**
* Runs a series of tests
*
* @returns {null} returns nothing
*/
const selftest = async function () {
const delay = (time) => new Promise((resolve) => setTimeout(resolve, time * 1000))
const records = 154000
const pb = new SimpleProgressBar({ records: records })
for (let i = 0; i < records; i += 1) {
pb.show({ currentRecord: i + 1 })
/* if (i < 3) {
if ((i / 100) > 0 && (i / 100) < 5) { */
// eslint-disable-next-line no-await-in-loop
/* await delay(3)
}
else { */
// eslint-disable-next-line no-await-in-loop
await delay(0.05)
// }
// i = Math.ceil(i + (Math.random() * records / 100))
}
}
selftest()