File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/tracing-internal/test/browser/metrics Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ const mockWindowLocation = {
16
16
hash : '' ,
17
17
} as Window [ 'location' ] ;
18
18
19
- // @ts -expect-error store a reference so we can reset it later
20
- const globalLocation = global . location ;
19
+ const originalLocation = WINDOW . location ;
21
20
22
21
const resourceEntryName = 'https://example.com/assets/to/css' ;
23
22
@@ -264,14 +263,14 @@ describe('_addResourceSpans', () => {
264
263
265
264
const setGlobalLocation = ( location : Location ) => {
266
265
// @ts -expect-error need to override global document
267
- global . location = mockWindowLocation ;
266
+ delete WINDOW . location ;
267
+ WINDOW . location = mockWindowLocation ;
268
268
269
269
console . log ( '\n\n WINDOW origin!! \n\n' ) ;
270
270
console . log ( WINDOW . location . origin ) ;
271
271
console . log ( '\n\n' ) ;
272
272
}
273
273
274
274
const resetGlobalLocation = ( ) => {
275
- // @ts -expect-error need to override global document
276
- global . location = globalLocation ;
275
+ WINDOW . location = originalLocation ;
277
276
}
You can’t perform that action at this time.
0 commit comments