Skip to content

Commit ea26419

Browse files
authored
v0.2.0-alpha.2
* feat(createTestEnvFile): add `FIREBASE_API_KEY ` to generated`cypress.env.json` (supports loading config from `firebase-ci` settings in `.firebaserc`)
1 parent 6e6f6c0 commit ea26419

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

cmds/createTestEnvFile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ function createTestEnvFile(envName) {
4242
// Throw if UID is missing in environment
4343
if (!uid) {
4444
/* eslint-disable */
45-
const errMsg = `${chalk.cyan(varName)} is missing from environment. Confirm that ${chalk.cyan(configPath)} contains either ${chalk.cyan(varName)} or ${chalk.cyan('TEST_UID')}.`;
45+
const errMsg = `${chalk.cyan(
46+
varName
47+
)} is missing from environment. Confirm that ${chalk.cyan(
48+
configPath
49+
)} contains either ${chalk.cyan(varName)} or ${chalk.cyan('TEST_UID')}.`;
4650
/* eslint-enable */
4751
return Promise.reject(new Error(errMsg));
4852
}
@@ -125,8 +129,12 @@ function createTestEnvFile(envName) {
125129
const newCypressConfig = Object.assign({}, currentCypressEnvSettings, {
126130
TEST_UID: envVarBasedOnCIEnv('TEST_UID'),
127131
FIREBASE_PROJECT_ID,
132+
FIREBASE_API_KEY:
133+
envVarBasedOnCIEnv('FIREBASE_API_KEY') ||
134+
get(firebaserc, `ci.createConfig.${envName}.firebase.apiKey`, ''),
128135
FIREBASE_AUTH_JWT: customToken
129136
});
137+
130138
const stageProjectId = envVarBasedOnCIEnv('STAGE_FIREBASE_PROJECT_ID');
131139
const stageApiKey = envVarBasedOnCIEnv('STAGE_FIREBASE_API_KEY');
132140

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cypress-firebase",
3-
"version": "0.2.0-alpha",
3+
"version": "0.2.0-alpha.2",
44
"description": "Utilities to help testing Firebase projects with Cypress.",
55
"main": "lib/index.js",
66
"module": "lib/index.js",

0 commit comments

Comments
 (0)