Skip to content

Commit 7ca0cb4

Browse files
committed
fix tests
1 parent 45eedbd commit 7ca0cb4

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

packages/browser/test/unit/profiling/utils.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { TextDecoder, TextEncoder } from 'util';
2-
// @ts-expect-error patch the encoder on the window, else importing JSDOM fails (deleted in afterAll)
32
const patchedEncoder = (!global.window.TextEncoder && (global.window.TextEncoder = TextEncoder)) || true;
43
// @ts-expect-error patch the encoder on the window, else importing JSDOM fails (deleted in afterAll)
54
const patchedDecoder = (!global.window.TextDecoder && (global.window.TextDecoder = TextDecoder)) || true;
@@ -19,31 +18,23 @@ const makeJSProfile = (partial: Partial<JSSelfProfile> = {}): JSSelfProfile => {
1918
};
2019
};
2120

22-
// @ts-expect-error store a reference so we can reset it later
2321
const globalDocument = global.document;
24-
// @ts-expect-error store a reference so we can reset it later
2522
const globalWindow = global.window;
26-
// @ts-expect-error store a reference so we can reset it later
2723
const globalLocation = global.location;
2824

2925
describe('convertJSSelfProfileToSampledFormat', () => {
3026
beforeEach(() => {
3127
const dom = new JSDOM();
32-
// @ts-expect-error need to override global document
3328
global.document = dom.window.document;
3429
// @ts-expect-error need to override global document
3530
global.window = dom.window;
36-
// @ts-expect-error need to override global document
3731
global.location = dom.window.location;
3832
});
3933

4034
// Reset back to previous values
4135
afterEach(() => {
42-
// @ts-expect-error need to override global document
4336
global.document = globalDocument;
44-
// @ts-expect-error need to override global document
4537
global.window = globalWindow;
46-
// @ts-expect-error need to override global document
4738
global.location = globalLocation;
4839
});
4940

packages/tracing-internal/test/browser/backgroundtab.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ describe('registerBackgroundTabDetection', () => {
99
let events: Record<string, any> = {};
1010
beforeEach(() => {
1111
const dom = new JSDOM();
12-
// @ts-expect-error need to override global document
1312
global.document = dom.window.document;
1413

1514
const options = getDefaultClientOptions({ tracesSampleRate: 1 });
@@ -19,7 +18,6 @@ describe('registerBackgroundTabDetection', () => {
1918

2019
addTracingExtensions();
2120

22-
// @ts-expect-error need to override global document
2321
global.document.addEventListener = jest.fn((event, callback) => {
2422
events[event] = callback;
2523
});

0 commit comments

Comments
 (0)