Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
before(function(done) {
this.timeout(10000);
if (process.env.FIREBASE_TEST_URL && process.env.FIREBASE_TEST_SECRET) {
console.log('using instance at', process.env.FIREBASE_TEST_URL);
global.firebase = new Firebase(process.env.FIREBASE_TEST_URL);
global.firebaseAuthSecret = process.env.FIREBASE_TEST_SECRET;
done();
} else if (process.env.FIREBASE_ADMIN_TOKEN) {
require('firebase-admin')
.bootstrapInstance(process.env.FIREBASE_ADMIN_TOKEN)
.delay(1000)
.then(function(instance) {
global.__bootstrappedFirebase = instance;
console.log('bootstrapped instance', instance.toString(), 'for tests');
global.firebase = new Firebase(instance.toString());
global.firebaseUrl = instance.toString();
return instance.getAuthTokens();
})
.then(function(tokens) {
global.firebaseAuthSecret = tokens[0];
}).done(done);
} else {