Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Aug 23, 2021
1 parent 0c424d6 commit 9222902
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/tracing/test/browser/metrics.test.ts
@@ -1,5 +1,11 @@
import { Span, Transaction } from '../../src';
import { _startChild, addResourceSpans, MetricsInstrumentation, ResourceEntry } from '../../src/browser/metrics';
import {
_startChild,
addResourceSpans,
DEFAULT_METRICS_INSTR_OPTIONS,
MetricsInstrumentation,
ResourceEntry,
} from '../../src/browser/metrics';
import { addDOMPropertiesToGlobal } from '../testutils';

// eslint-disable-next-line @typescript-eslint/no-explicit-any, no-var
Expand Down Expand Up @@ -178,7 +184,7 @@ describe('MetricsInstrumentation', () => {
jest.spyOn(MetricsInstrumentation.prototype as any, tracker),
);

new MetricsInstrumentation();
new MetricsInstrumentation(DEFAULT_METRICS_INSTR_OPTIONS);

trackers.forEach(tracker => expect(tracker).not.toBeCalled());
});
Expand All @@ -191,7 +197,7 @@ describe('MetricsInstrumentation', () => {
const trackers = ['_trackCLS', '_trackLCP', '_trackFID'].map(tracker =>
jest.spyOn(MetricsInstrumentation.prototype as any, tracker),
);
new MetricsInstrumentation();
new MetricsInstrumentation(DEFAULT_METRICS_INSTR_OPTIONS);
global.process = backup;

trackers.forEach(tracker => expect(tracker).toBeCalled());
Expand Down

0 comments on commit 9222902

Please sign in to comment.