2
0
mirror of synced 2025-01-23 04:39:49 +00:00

[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

View File

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