@@ -11,7 +11,7 @@ describe('React Router v4', () => {
1111 startTransactionOnPageLoad ?: boolean ;
1212 startTransactionOnLocationChange ?: boolean ;
1313 routes ?: RouteConfig [ ] ;
14- } ) : [ jest . Mock , any , { mockSetName : jest . Mock ; mockFinish : jest . Mock ; mockSetMetadata : jest . Mock } ] {
14+ } ) : [ jest . Mock , any , { mockSetName : jest . Mock ; mockFinish : jest . Mock } ] {
1515 const options = {
1616 matchPath : _opts && _opts . routes !== undefined ? matchPath : undefined ,
1717 routes : undefined ,
@@ -22,16 +22,13 @@ describe('React Router v4', () => {
2222 const history = createMemoryHistory ( ) ;
2323 const mockFinish = jest . fn ( ) ;
2424 const mockSetName = jest . fn ( ) ;
25- const mockSetMetadata = jest . fn ( ) ;
26- const mockStartTransaction = jest
27- . fn ( )
28- . mockReturnValue ( { setName : mockSetName , finish : mockFinish , setMetadata : mockSetMetadata } ) ;
25+ const mockStartTransaction = jest . fn ( ) . mockReturnValue ( { setName : mockSetName , finish : mockFinish } ) ;
2926 reactRouterV4Instrumentation ( history , options . routes , options . matchPath ) (
3027 mockStartTransaction ,
3128 options . startTransactionOnPageLoad ,
3229 options . startTransactionOnLocationChange ,
3330 ) ;
34- return [ mockStartTransaction , history , { mockSetName, mockFinish, mockSetMetadata } ] ;
31+ return [ mockStartTransaction , history , { mockSetName, mockFinish } ] ;
3532 }
3633
3734 it ( 'starts a pageload transaction when instrumentation is started' , ( ) => {
@@ -164,7 +161,7 @@ describe('React Router v4', () => {
164161 } ) ;
165162
166163 it ( 'normalizes transaction name with custom Route' , ( ) => {
167- const [ mockStartTransaction , history , { mockSetName, mockSetMetadata } ] = createInstrumentation ( ) ;
164+ const [ mockStartTransaction , history , { mockSetName } ] = createInstrumentation ( ) ;
168165 const SentryRoute = withSentryRouting ( Route ) ;
169166 const { getByText } = render (
170167 < Router history = { history } >
@@ -189,12 +186,11 @@ describe('React Router v4', () => {
189186 metadata : { source : 'url' } ,
190187 } ) ;
191188 expect ( mockSetName ) . toHaveBeenCalledTimes ( 2 ) ;
192- expect ( mockSetName ) . toHaveBeenLastCalledWith ( '/users/:userid' ) ;
193- expect ( mockSetMetadata ) . toHaveBeenLastCalledWith ( { source : 'route' } ) ;
189+ expect ( mockSetName ) . toHaveBeenLastCalledWith ( '/users/:userid' , 'route' ) ;
194190 } ) ;
195191
196192 it ( 'normalizes nested transaction names with custom Route' , ( ) => {
197- const [ mockStartTransaction , history , { mockSetName, mockSetMetadata } ] = createInstrumentation ( ) ;
193+ const [ mockStartTransaction , history , { mockSetName } ] = createInstrumentation ( ) ;
198194 const SentryRoute = withSentryRouting ( Route ) ;
199195 const { getByText } = render (
200196 < Router history = { history } >
@@ -219,8 +215,7 @@ describe('React Router v4', () => {
219215 metadata : { source : 'url' } ,
220216 } ) ;
221217 expect ( mockSetName ) . toHaveBeenCalledTimes ( 2 ) ;
222- expect ( mockSetName ) . toHaveBeenLastCalledWith ( '/organizations/:orgid/v1/:teamid' ) ;
223- expect ( mockSetMetadata ) . toHaveBeenLastCalledWith ( { source : 'route' } ) ;
218+ expect ( mockSetName ) . toHaveBeenLastCalledWith ( '/organizations/:orgid/v1/:teamid' , 'route' ) ;
224219
225220 act ( ( ) => {
226221 history . push ( '/organizations/543' ) ;
@@ -235,8 +230,7 @@ describe('React Router v4', () => {
235230 metadata : { source : 'url' } ,
236231 } ) ;
237232 expect ( mockSetName ) . toHaveBeenCalledTimes ( 3 ) ;
238- expect ( mockSetName ) . toHaveBeenLastCalledWith ( '/organizations/:orgid' ) ;
239- expect ( mockSetMetadata ) . toHaveBeenLastCalledWith ( { source : 'route' } ) ;
233+ expect ( mockSetName ) . toHaveBeenLastCalledWith ( '/organizations/:orgid' , 'route' ) ;
240234 } ) ;
241235
242236 it ( 'matches with route object' , ( ) => {
0 commit comments