Skip to content

Commit f3b8e4c

Browse files
authored
Fix analytics test warnings (#8556)
1 parent 5f3ef9d commit f3b8e4c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

packages/analytics/testing/get-fake-firebase-services.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FirebaseApp, initializeApp, _registerComponent } from '@firebase/app';
18+
import {
19+
FirebaseApp,
20+
initializeApp,
21+
_registerComponent,
22+
_addOrOverwriteComponent
23+
} from '@firebase/app';
1924
import { Component, ComponentType } from '@firebase/component';
2025
import { _FirebaseInstallationsInternal } from '@firebase/installations';
2126
import { AnalyticsService } from '../src/factory';
@@ -78,5 +83,18 @@ export function getFullApp(fakeAppParams?: {
7883
)
7984
);
8085
const app = initializeApp({ ...fakeConfig, ...fakeAppParams });
86+
_addOrOverwriteComponent(
87+
app,
88+
//@ts-ignore
89+
new Component(
90+
'heartbeat',
91+
() => {
92+
return {
93+
triggerHeartbeat: () => {}
94+
} as any;
95+
},
96+
ComponentType.PUBLIC
97+
)
98+
);
8199
return app;
82100
}

0 commit comments

Comments
 (0)