@@ -90,6 +90,24 @@ describe('React Router server SDK', () => {
90
90
expect ( reactRouterServerIntegration ) . toBeDefined ( ) ;
91
91
} ) ;
92
92
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://[email protected] /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
+
93
111
it ( 'does not add reactRouterServer integration for Node.js 20.19' , ( ) => {
94
112
vi . spyOn ( SentryNode , 'NODE_VERSION' , 'get' ) . mockReturnValue ( { major : 20 , minor : 19 , patch : 0 } ) ;
95
113
@@ -107,5 +125,23 @@ describe('React Router server SDK', () => {
107
125
108
126
expect ( reactRouterServerIntegration ) . toBeUndefined ( ) ;
109
127
} ) ;
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://[email protected] /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
+ } ) ;
110
146
} ) ;
111
147
} ) ;
0 commit comments