@@ -49,6 +49,7 @@ describe('sveltekitRoutingInstrumentation', () => {
49
49
} ) ;
50
50
51
51
it ( "starts a pageload transaction when it's called with default params" , ( ) => {
52
+ // eslint-disable-next-line deprecation/deprecation
52
53
svelteKitRoutingInstrumentation ( mockedStartTransaction ) ;
53
54
54
55
expect ( mockedStartTransaction ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -66,7 +67,6 @@ describe('sveltekitRoutingInstrumentation', () => {
66
67
} ) ;
67
68
68
69
// We emit an update to the `page` store to simulate the SvelteKit router lifecycle
69
- // @ts -expect-error This is fine because we testUtils/stores.ts defines `page` as a writable store
70
70
page . set ( { route : { id : 'testRoute' } } ) ;
71
71
72
72
// This should update the transaction name with the parameterized route:
@@ -76,15 +76,16 @@ describe('sveltekitRoutingInstrumentation', () => {
76
76
} ) ;
77
77
78
78
it ( "doesn't start a pageload transaction if `startTransactionOnPageLoad` is false" , ( ) => {
79
+ // eslint-disable-next-line deprecation/deprecation
79
80
svelteKitRoutingInstrumentation ( mockedStartTransaction , false ) ;
80
81
expect ( mockedStartTransaction ) . toHaveBeenCalledTimes ( 0 ) ;
81
82
} ) ;
82
83
83
84
it ( "doesn't start a navigation transaction when `startTransactionOnLocationChange` is false" , ( ) => {
85
+ // eslint-disable-next-line deprecation/deprecation
84
86
svelteKitRoutingInstrumentation ( mockedStartTransaction , false , false ) ;
85
87
86
88
// We emit an update to the `navigating` store to simulate the SvelteKit navigation lifecycle
87
- // @ts -expect-error This is fine because we testUtils/stores.ts defines `navigating` as a writable store
88
89
navigating . set ( {
89
90
from : { route : { id : '/users' } , url : { pathname : '/users' } } ,
90
91
to : { route : { id : '/users/[id]' } , url : { pathname : '/users/7762' } } ,
@@ -95,10 +96,10 @@ describe('sveltekitRoutingInstrumentation', () => {
95
96
} ) ;
96
97
97
98
it ( 'starts a navigation transaction when `startTransactionOnLocationChange` is true' , ( ) => {
99
+ // eslint-disable-next-line deprecation/deprecation
98
100
svelteKitRoutingInstrumentation ( mockedStartTransaction , false , true ) ;
99
101
100
102
// We emit an update to the `navigating` store to simulate the SvelteKit navigation lifecycle
101
- // @ts -expect-error This is fine because we testUtils/stores.ts defines `navigating` as a writable store
102
103
navigating . set ( {
103
104
from : { route : { id : '/users' } , url : { pathname : '/users' } } ,
104
105
to : { route : { id : '/users/[id]' } , url : { pathname : '/users/7762' } } ,
@@ -127,18 +128,17 @@ describe('sveltekitRoutingInstrumentation', () => {
127
128
expect ( returnedTransaction ?. setTag ) . toHaveBeenCalledWith ( 'from' , '/users' ) ;
128
129
129
130
// We emit `null` here to simulate the end of the navigation lifecycle
130
- // @ts -expect-error this is fine
131
131
navigating . set ( null ) ;
132
132
133
133
expect ( routingSpanFinishSpy ) . toHaveBeenCalledTimes ( 1 ) ;
134
134
} ) ;
135
135
136
136
describe ( 'handling same origin and destination navigations' , ( ) => {
137
137
it ( "doesn't start a navigation transaction if the raw navigation origin and destination are equal" , ( ) => {
138
+ // eslint-disable-next-line deprecation/deprecation
138
139
svelteKitRoutingInstrumentation ( mockedStartTransaction , false , true ) ;
139
140
140
141
// We emit an update to the `navigating` store to simulate the SvelteKit navigation lifecycle
141
- // @ts -expect-error This is fine because we testUtils/stores.ts defines `navigating` as a writable store
142
142
navigating . set ( {
143
143
from : { route : { id : '/users/[id]' } , url : { pathname : '/users/7762' } } ,
144
144
to : { route : { id : '/users/[id]' } , url : { pathname : '/users/7762' } } ,
@@ -148,9 +148,9 @@ describe('sveltekitRoutingInstrumentation', () => {
148
148
} ) ;
149
149
150
150
it ( 'starts a navigation transaction if the raw navigation origin and destination are not equal' , ( ) => {
151
+ // eslint-disable-next-line deprecation/deprecation
151
152
svelteKitRoutingInstrumentation ( mockedStartTransaction , false , true ) ;
152
153
153
- // @ts -expect-error This is fine
154
154
navigating . set ( {
155
155
from : { route : { id : '/users/[id]' } , url : { pathname : '/users/7762' } } ,
156
156
to : { route : { id : '/users/[id]' } , url : { pathname : '/users/223412' } } ,
@@ -179,11 +179,11 @@ describe('sveltekitRoutingInstrumentation', () => {
179
179
} ) ;
180
180
181
181
it ( 'falls back to `window.location.pathname` to determine the raw origin' , ( ) => {
182
+ // eslint-disable-next-line deprecation/deprecation
182
183
svelteKitRoutingInstrumentation ( mockedStartTransaction , false , true ) ;
183
184
184
185
// window.location.pathame is "/" in tests
185
186
186
- // @ts -expect-error This is fine
187
187
navigating . set ( {
188
188
to : { route : { } , url : { pathname : '/' } } ,
189
189
} ) ;
0 commit comments