Skip to content

Commit

Permalink
Fix analytics test warnings (#8556)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored Oct 2, 2024
1 parent 5f3ef9d commit f3b8e4c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/analytics/testing/get-fake-firebase-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}

0 comments on commit f3b8e4c

Please sign in to comment.