@@ -90,6 +90,24 @@ describe('React Router server SDK', () => {
9090 expect ( reactRouterServerIntegration ) . toBeDefined ( ) ;
9191 } ) ;
9292
93+ it ( 'adds reactRouterServer integration for Node.js 22.11' , ( ) => {
94+ vi . spyOn ( SentryNode , 'NODE_VERSION' , 'get' ) . mockReturnValue ( { major : 22 , minor : 11 , patch : 0 } ) ;
95+
96+ reactRouterInit ( {
97+ dsn : 'https://public@dsn.ingest.sentry.io/1337' ,
98+ } ) ;
99+
100+ expect ( nodeInit ) . toHaveBeenCalledTimes ( 1 ) ;
101+ const initOptions = nodeInit . mock . calls [ 0 ] ?. [ 0 ] ;
102+ const defaultIntegrations = initOptions ?. defaultIntegrations as Integration [ ] ;
103+
104+ const reactRouterServerIntegration = defaultIntegrations . find (
105+ integration => integration . name === 'ReactRouterServer' ,
106+ ) ;
107+
108+ expect ( reactRouterServerIntegration ) . toBeDefined ( ) ;
109+ } ) ;
110+
93111 it ( 'does not add reactRouterServer integration for Node.js 20.19' , ( ) => {
94112 vi . spyOn ( SentryNode , 'NODE_VERSION' , 'get' ) . mockReturnValue ( { major : 20 , minor : 19 , patch : 0 } ) ;
95113
@@ -107,5 +125,23 @@ describe('React Router server SDK', () => {
107125
108126 expect ( reactRouterServerIntegration ) . toBeUndefined ( ) ;
109127 } ) ;
128+
129+ it ( 'does not add reactRouterServer integration for Node.js 22.12' , ( ) => {
130+ vi . spyOn ( SentryNode , 'NODE_VERSION' , 'get' ) . mockReturnValue ( { major : 22 , minor : 12 , patch : 0 } ) ;
131+
132+ reactRouterInit ( {
133+ dsn : 'https://public@dsn.ingest.sentry.io/1337' ,
134+ } ) ;
135+
136+ expect ( nodeInit ) . toHaveBeenCalledTimes ( 1 ) ;
137+ const initOptions = nodeInit . mock . calls [ 0 ] ?. [ 0 ] ;
138+ const defaultIntegrations = initOptions ?. defaultIntegrations as Integration [ ] ;
139+
140+ const reactRouterServerIntegration = defaultIntegrations . find (
141+ integration => integration . name === 'ReactRouterServer' ,
142+ ) ;
143+
144+ expect ( reactRouterServerIntegration ) . toBeUndefined ( ) ;
145+ } ) ;
110146 } ) ;
111147} ) ;
0 commit comments