Skip to content

Commit c0502c8

Browse files
committed
Added debug statement for firebase private key
1 parent f3a699a commit c0502c8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/firestore/firestore-admin.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { type FirestoreCollection, FirestoreDocument } from '../../src/admin';
33
import { initializeApp, cert } from 'firebase-admin/app';
44
import { configDotenv } from 'dotenv';
55
import { getFirestore } from 'firebase-admin/firestore';
6+
import { Sha512, BytesCoder } from '@stevenkellner/typescript-common-functionality';
67

78
export type FirestoreScheme = FirestoreDocument<never, {
89
baseCollection: FirestoreCollection<{
@@ -52,6 +53,9 @@ describe('Firestore admin', () => {
5253
});
5354
process.env.FIRESTORE_EMULATOR_HOST = '127.0.0.1:8080';
5455
baseDocument = FirestoreDocument.base(getFirestore());
56+
if (process.env.FIREBASE_PRIVATE_KEY === undefined)
57+
throw new Error('FIREBASE_PRIVATE_KEY is not set');
58+
console.log(BytesCoder.toHex(new Sha512().hash(BytesCoder.fromUtf8(process.env.FIREBASE_PRIVATE_KEY))));
5559
});
5660

5761
afterEach(async () => {

test/functions/firebaseFunctions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class FirebaseFunctions {
112112
public firebaseFunctionsWithInvalidMacKey!: typeof this.firebaseFunctions;
113113

114114
public setup(): void {
115-
configDotenv({ path: 'test/.env.testd' });
115+
configDotenv({ path: 'test/.env.test' });
116116
initializeApp({
117117
apiKey: process.env.FIREBASE_API_KEY,
118118
authDomain: process.env.FIREBASE_AUTH_DOMAIN,

0 commit comments

Comments
 (0)