Skip to content

Commit

Permalink
feat(perf): Expose modular API that matches the Firebase web JS SDK v…
Browse files Browse the repository at this point in the history
…9 API (#6771)

Co-authored-by: Mike Hardy <github@mikehardy.net>
  • Loading branch information
russellwheatley and mikehardy committed Feb 3, 2023
1 parent 53a4362 commit 4e170ea
Show file tree
Hide file tree
Showing 11 changed files with 1,693 additions and 12 deletions.
8 changes: 4 additions & 4 deletions packages/perf/__tests__/perf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ describe('Performance Monitoring', function () {

describe('setPerformanceCollectionEnabled', function () {
it('errors if not boolean', function () {
expect(() => {
expect(async () => {
// @ts-ignore
perf().setPerformanceCollectionEnabled();
}).toThrow('must be a boolean');
await perf().setPerformanceCollectionEnabled();
}).rejects.toThrow('must be a boolean');
});
});

Expand Down Expand Up @@ -109,7 +109,7 @@ describe('Performance Monitoring', function () {
it('errors if not boolean', async function () {
try {
// @ts-ignore
firebase.perf().setPerformanceCollectionEnabled();
await firebase.perf().setPerformanceCollectionEnabled();
return Promise.reject(new Error('Did not throw'));
} catch (e: any) {
expect(e.message).toEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public Map<String, Object> getConstants() {
constants.put(
"isPerformanceCollectionEnabled",
FirebasePerformance.getInstance().isPerformanceCollectionEnabled());
constants.put(
"isInstrumentationEnabled",
true);
return constants;
}

Expand Down
Loading

1 comment on commit 4e170ea

@vercel
Copy link

@vercel vercel bot commented on 4e170ea Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.