Skip to content

Commit 3c83b80

Browse files
committed
try deleting
1 parent 2bc3a4f commit 3c83b80

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/tracing-internal/test/browser/metrics/index.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ const mockWindowLocation = {
1616
hash: '',
1717
} as Window['location'];
1818

19-
// @ts-expect-error store a reference so we can reset it later
20-
const globalLocation = global.location;
19+
const originalLocation = WINDOW.location;
2120

2221
const resourceEntryName = 'https://example.com/assets/to/css';
2322

@@ -264,14 +263,14 @@ describe('_addResourceSpans', () => {
264263

265264
const setGlobalLocation = (location: Location) => {
266265
// @ts-expect-error need to override global document
267-
global.location = mockWindowLocation;
266+
delete WINDOW.location;
267+
WINDOW.location = mockWindowLocation;
268268

269269
console.log('\n\n WINDOW origin!! \n\n');
270270
console.log(WINDOW.location.origin);
271271
console.log('\n\n');
272272
}
273273

274274
const resetGlobalLocation = () => {
275-
// @ts-expect-error need to override global document
276-
global.location = globalLocation;
275+
WINDOW.location = originalLocation;
277276
}

0 commit comments

Comments
 (0)