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; }