From f3b8e4ce3e0e3e4721f6177509ee107133fa1595 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 2 Oct 2024 09:41:19 -0700 Subject: [PATCH] Fix analytics test warnings (#8556) --- .../testing/get-fake-firebase-services.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/analytics/testing/get-fake-firebase-services.ts b/packages/analytics/testing/get-fake-firebase-services.ts index 596e431e0b2..4d666a76d25 100644 --- a/packages/analytics/testing/get-fake-firebase-services.ts +++ b/packages/analytics/testing/get-fake-firebase-services.ts @@ -15,7 +15,12 @@ * limitations under the License. */ -import { FirebaseApp, initializeApp, _registerComponent } from '@firebase/app'; +import { + FirebaseApp, + initializeApp, + _registerComponent, + _addOrOverwriteComponent +} from '@firebase/app'; import { Component, ComponentType } from '@firebase/component'; import { _FirebaseInstallationsInternal } from '@firebase/installations'; import { AnalyticsService } from '../src/factory'; @@ -78,5 +83,18 @@ export function getFullApp(fakeAppParams?: { ) ); const app = initializeApp({ ...fakeConfig, ...fakeAppParams }); + _addOrOverwriteComponent( + app, + //@ts-ignore + new Component( + 'heartbeat', + () => { + return { + triggerHeartbeat: () => {} + } as any; + }, + ComponentType.PUBLIC + ) + ); return app; }