(count, oldStyle)
| 14 | const last = arr => arr[arr.length - 1] |
| 15 | const range = (n) => Array.from(Array(n).keys()) |
| 16 | const makeOldLogs = (count, oldStyle) => { |
| 17 | const d = new Date() |
| 18 | d.setHours(-1) |
| 19 | d.setSeconds(0) |
| 20 | return range(oldStyle ? count : (count / 2)).reduce((acc, i) => { |
| 21 | const cloneDate = new Date(d.getTime()) |
| 22 | cloneDate.setSeconds(i) |
| 23 | const dateId = getId(cloneDate) |
| 24 | if (oldStyle) { |
| 25 | acc[`${dateId}-debug.log`] = 'hello' |
| 26 | } else { |
| 27 | acc[`${dateId}-debug-0.log`] = 'hello' |
| 28 | acc[`${dateId}-debug-1.log`] = 'hello' |
| 29 | } |
| 30 | return acc |
| 31 | }, {}) |
| 32 | } |
| 33 | |
| 34 | const cleanErr = (message) => { |
| 35 | const err = new Error(message) |
no test coverage detected