[tests][firestore] testDocRef helper - returns a prefixed document id ref for current test iteration

This commit is contained in:
Salakar 2018-04-16 17:45:01 +01:00
parent 88410b409a
commit ead1edff4e
1 changed files with 8 additions and 0 deletions

View File

@ -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);