👷 Fancy test
This commit is contained in:
parent
3575dae75c
commit
1b3568e66e
1 changed files with 9 additions and 1 deletions
|
@ -261,9 +261,17 @@ describe('crashReporter module', () => {
|
|||
const reports = crashReporter.getUploadedReports()
|
||||
const lastReport = crashReporter.getLastCrashReport()
|
||||
|
||||
// Let's find the newest report
|
||||
const newestReport = reports.reduce((acc, cur) => {
|
||||
const timestamp = new Date(cur.timestamp).getTime();
|
||||
return (timestamp > acc.timestamp)
|
||||
? { report: cur, timestamp: timestamp }
|
||||
: acc
|
||||
}, { timestamp: 0 })
|
||||
|
||||
// In our case, the first report is actually the newest
|
||||
assert(lastReport != null)
|
||||
assert(lastReport === reports[0])
|
||||
assert(lastReport === newestReport.report)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue