File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/tracing-internal/test/browser/metrics Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ const mockWindowLocation = {
16
16
hash : ""
17
17
} as Window [ 'location' ] ;
18
18
19
- WINDOW . location = mockWindowLocation ;
20
-
19
+ const originalWindowLocation = WINDOW . location ;
21
20
const resourceEntryName = 'https://example.com/assets/to/css' ;
22
21
23
22
describe ( '_addMeasureSpans' , ( ) => {
24
23
// eslint-disable-next-line deprecation/deprecation
25
24
const transaction = new Transaction ( { op : 'pageload' , name : '/' } ) ;
25
+
26
26
beforeEach ( ( ) => {
27
27
// eslint-disable-next-line deprecation/deprecation
28
28
transaction . startChild = jest . fn ( ) ;
@@ -60,6 +60,15 @@ describe('_addMeasureSpans', () => {
60
60
describe ( '_addResourceSpans' , ( ) => {
61
61
// eslint-disable-next-line deprecation/deprecation
62
62
const transaction = new Transaction ( { op : 'pageload' , name : '/' } ) ;
63
+
64
+ beforeAll ( ( ) => {
65
+ WINDOW . location = mockWindowLocation ;
66
+ } )
67
+
68
+ afterAll ( ( ) => {
69
+ WINDOW . location = originalWindowLocation ;
70
+ } )
71
+
63
72
beforeEach ( ( ) => {
64
73
// eslint-disable-next-line deprecation/deprecation
65
74
transaction . startChild = jest . fn ( ) ;
You can’t perform that action at this time.
0 commit comments