Socket
Socket
Sign inDemoInstall

cypress-firebase

Package Overview
Dependencies
205
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

20

lib-esm/firebase-utils.js

@@ -1,2 +0,1 @@

import { getServiceAccount } from './node-utils';
import { convertValueToTimestampOrGeoPointIfPossible } from './tasks';

@@ -32,3 +31,22 @@ /**

}
/* eslint-enable camelcase */
/**
* Get service account from either SERVICE_ACCOUNT environment variable
* @returns Service account object
*/
function getServiceAccount() {
// Environment variable
const serviceAccountEnvVar = process.env.SERVICE_ACCOUNT;
if (serviceAccountEnvVar) {
try {
return JSON.parse(serviceAccountEnvVar);
}
catch (err) {
/* eslint-disable no-console */
console.warn(`cypress-firebase: Issue parsing "SERVICE_ACCOUNT" environment variable from string to object, returning string`);
/* eslint-enable no-console */
}
}
}
/**
* @param adminInstance - firebase-admin instance to initialize

@@ -35,0 +53,0 @@ * @returns Firebase admin credential

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteCollection = exports.slashPathToFirestoreRef = exports.applyWhere = exports.isDocPath = exports.initializeFirebase = exports.isString = void 0;
const node_utils_1 = require("./node-utils");
const tasks_1 = require("./tasks");

@@ -36,3 +35,22 @@ /**

}
/* eslint-enable camelcase */
/**
* Get service account from either SERVICE_ACCOUNT environment variable
* @returns Service account object
*/
function getServiceAccount() {
// Environment variable
const serviceAccountEnvVar = process.env.SERVICE_ACCOUNT;
if (serviceAccountEnvVar) {
try {
return JSON.parse(serviceAccountEnvVar);
}
catch (err) {
/* eslint-disable no-console */
console.warn(`cypress-firebase: Issue parsing "SERVICE_ACCOUNT" environment variable from string to object, returning string`);
/* eslint-enable no-console */
}
}
}
/**
* @param adminInstance - firebase-admin instance to initialize

@@ -42,3 +60,3 @@ * @returns Firebase admin credential

function getFirebaseCredential(adminInstance) {
const serviceAccount = (0, node_utils_1.getServiceAccount)();
const serviceAccount = getServiceAccount();
// Add service account credential if it exists so that custom auth tokens can be generated

@@ -45,0 +63,0 @@ if (serviceAccount) {

2

package.json
{
"name": "cypress-firebase",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "Utilities to help testing Firebase projects with Cypress.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc