Skip to content

Commit ef97831

Browse files
committed
chore: Correct telemetry unit test coverage
1 parent f51bfad commit ef97831

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/app/hooks/useGlean.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import { useExperiments } from "../../contextProviders/experiments";
1414
export const useGlean = () => {
1515
const session = useSession();
1616
const experimentData = useExperiments();
17+
// Telemetry recording is mocked in our unit tests, therefore we
18+
// do not have test coverage for this method.
19+
/* c8 ignore start */
1720
const isPremiumUser = hasPremium(session.data?.user);
18-
1921
const record = useCallback(
2022
async <
2123
EventModule extends keyof GleanMetricMap,
@@ -64,6 +66,7 @@ export const useGlean = () => {
6466
},
6567
[isPremiumUser, experimentData],
6668
);
69+
/* c8 ignore end */
6770

6871
return record;
6972
};

src/app/hooks/useTelemetry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const useTelemetry = () => {
2323
const recordGlean = useGlean();
2424

2525
const { Glean, Ga } = TelemetryPlatforms;
26+
// Telemetry recording is mocked in our unit tests, therefore we
27+
// do not have test coverage for this method.
28+
/* c8 ignore start */
2629
const recordTelemetry = useCallback(
2730
<
2831
EventModule extends keyof GleanMetricMap,
@@ -51,6 +54,7 @@ export const useTelemetry = () => {
5154
},
5255
[Ga, Glean, path, recordGlean],
5356
);
57+
/* c8 ignore stop */
5458

5559
return recordTelemetry;
5660
};

0 commit comments

Comments
 (0)