* After being returned from Browserstack, benchmark results are stored as * a list of fulfilled promises. * * As results are being iterated through, this function handles taking a result, * serializing it, and pushing it to Firestore. * * @param db Reference to Firestore collection * @param r
(db, resultId, result)
| 60 | * @param result Individual result in a list of fulfilled promises |
| 61 | */ |
| 62 | async function addResultToFirestore(db, resultId, result) { |
| 63 | try { |
| 64 | const firestoreMap = |
| 65 | formatForFirestore(result, makeCompatableWithFirestore, getReadableDate); |
| 66 | await db.add({ result: firestoreMap }).then((ref) => { |
| 67 | console.log(`Added ${resultId} to Firestore with ID: ${ref.id}`); |
| 68 | }); |
| 69 | } catch (err) { |
| 70 | throw err; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * This functions calls other formatting functions on a benchmark result so that |
no test coverage detected
searching dependent graphs…