Skip to content

Commit 4e170ea

Browse files
feat(perf): Expose modular API that matches the Firebase web JS SDK v9 API (#6771)
Co-authored-by: Mike Hardy <github@mikehardy.net>
1 parent 53a4362 commit 4e170ea

11 files changed

Lines changed: 1693 additions & 12 deletions

File tree

packages/perf/__tests__/perf.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ describe('Performance Monitoring', function () {
1313

1414
describe('setPerformanceCollectionEnabled', function () {
1515
it('errors if not boolean', function () {
16-
expect(() => {
16+
expect(async () => {
1717
// @ts-ignore
18-
perf().setPerformanceCollectionEnabled();
19-
}).toThrow('must be a boolean');
18+
await perf().setPerformanceCollectionEnabled();
19+
}).rejects.toThrow('must be a boolean');
2020
});
2121
});
2222

@@ -109,7 +109,7 @@ describe('Performance Monitoring', function () {
109109
it('errors if not boolean', async function () {
110110
try {
111111
// @ts-ignore
112-
firebase.perf().setPerformanceCollectionEnabled();
112+
await firebase.perf().setPerformanceCollectionEnabled();
113113
return Promise.reject(new Error('Did not throw'));
114114
} catch (e: any) {
115115
expect(e.message).toEqual(

packages/perf/android/src/main/java/io/invertase/firebase/perf/UniversalFirebasePerfModule.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public Map<String, Object> getConstants() {
5555
constants.put(
5656
"isPerformanceCollectionEnabled",
5757
FirebasePerformance.getInstance().isPerformanceCollectionEnabled());
58+
constants.put(
59+
"isInstrumentationEnabled",
60+
true);
5861
return constants;
5962
}
6063

0 commit comments

Comments
 (0)