[tests] added global.testRunId - should be used to prevent conflicts when multiple builds/tests are running - tests need to use this e.g. someDoc = `collection-tests/${testRunId}foobar`

This commit is contained in:
Salakar 2018-04-12 08:13:29 +01:00
parent 0be999a691
commit 85efdecb1a
1 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable global-require */
global.sinon = require('sinon');
require('should-sinon');
global.should = require('should');
@ -26,6 +27,8 @@ global.randomString = (length, chars) => {
global.firebaseAdmin = require('firebase-admin');
global.testRunId = randomString(4, 'aA#');
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.cert(require('./service-account')),
databaseURL: 'https://rnfirebase-b9ad4.firebaseio.com',
@ -44,3 +47,7 @@ console.log = (...args) => {
return originalLog(...args);
};
global.TestHelpers = {
firestore: require('./firestore'),
};