Skip to content

Commit dc79d68

Browse files
committed
Revert "Fix test import statements"
This reverts commit 25300aa. The previous commit changed import statements for firebase-admin and firebase-functions to default imports, which caused the extension deployment to fail with runtime errors (Cannot read properties of undefined (reading 'auth')). The correct usage is to use namespace imports (import * as admin from 'firebase-admin'). This revert restores the working import style and fixes the deployment issue.
1 parent 113b580 commit dc79d68

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

firestore-stripe-payments/functions/__tests__/helpers/collections.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentReference, DocumentData } from '@google-cloud/firestore';
33
import {
44
waitForDocumentToExistInCollection,

firestore-stripe-payments/functions/__tests__/helpers/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { Query, DocumentData } from '@google-cloud/firestore';
33
import { UserRecord } from 'firebase-functions/v1/auth';
44

firestore-stripe-payments/functions/__tests__/tests/checkoutsessions/createCheckoutSession.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentReference, DocumentData } from '@google-cloud/firestore';
33
import { UserRecord } from 'firebase-functions/v1/auth';
44
import setupEmulator from '../../helpers/setupEmulator';

firestore-stripe-payments/functions/__tests__/tests/checkoutsessions/subscriptionCheckoutSessions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import runCheckout from '../../helpers/forms/runCheckout';
33

44
import { UserRecord } from 'firebase-functions/v1/auth';

firestore-stripe-payments/functions/__tests__/tests/customers/createCustomer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentData } from '@google-cloud/firestore';
33

44
import setupEmulator from '../../helpers/setupEmulator';

firestore-stripe-payments/functions/__tests__/tests/customers/customerDataDeleted.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentData } from '@google-cloud/firestore';
33
import setupEmulator from './../../helpers/setupEmulator';
44
import { findCustomer } from './../../helpers/stripeApi/customers';

firestore-stripe-payments/functions/__tests__/tests/portalLinks/createPortalLink.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentData } from '@google-cloud/firestore';
33
import functions from 'firebase-functions-test';
44
import * as cloudFunctions from '../../../src';

firestore-stripe-payments/functions/__tests__/tests/webhookevents/handleWebhookEvents.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentData } from '@google-cloud/firestore';
33
import { Product } from '../../../src/interfaces';
44
import setupEmulator from '../../helpers/setupEmulator';

firestore-stripe-payments/functions/__tests__/tests/webhookevents/subscriptions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import admin from 'firebase-admin';
1+
import * as admin from 'firebase-admin';
22
import { DocumentData } from '@google-cloud/firestore';
33
import { Subscription } from '../../../src/interfaces';
44
import setupEmulator from '../../helpers/setupEmulator';

firestore-stripe-payments/functions/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import admin from 'firebase-admin';
17+
import * as admin from 'firebase-admin';
1818
import { getEventarc } from 'firebase-admin/eventarc';
19-
import functions from 'firebase-functions';
19+
import * as functions from 'firebase-functions';
2020
import Stripe from 'stripe';
2121
import {
2222
Product,

0 commit comments

Comments
 (0)