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 = {
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
2221const resourceEntryName = 'https://example.com/assets/to/css' ;
2322
@@ -264,14 +263,14 @@ describe('_addResourceSpans', () => {
264263
265264const 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
274274const resetGlobalLocation = ( ) => {
275- // @ts -expect-error need to override global document
276- global . location = globalLocation ;
275+ WINDOW . location = originalLocation ;
277276}
You can’t perform that action at this time.
0 commit comments