From ead1edff4e8d00530cbbe1c7c0b9ba04fe9ac4bb Mon Sep 17 00:00:00 2001 From: Salakar Date: Mon, 16 Apr 2018 17:45:01 +0100 Subject: [PATCH] [tests][firestore] testDocRef helper - returns a prefixed document id ref for current test iteration --- bridge/helpers/firestore.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bridge/helpers/firestore.js b/bridge/helpers/firestore.js index adec181c..49983cbb 100644 --- a/bridge/helpers/firestore.js +++ b/bridge/helpers/firestore.js @@ -75,6 +75,14 @@ module.exports = { return Promise.resolve(); }, + testDocRef(docId) { + shouldCleanup = true; + return firebase + .firestore() + .collection(TEST_COLLECTION_NAME) + .doc(`${testRunId}${docId}`); + }, + testCollection(collection) { shouldCleanup = true; return firebase.firestore().collection(collection || TEST_COLLECTION_NAME);