File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,12 @@ describe('SSO', () => {
302302 expect ( fetch . mock . calls . length ) . toEqual ( 1 ) ;
303303
304304 expect ( fetchBody ( ) ) . toMatchSnapshot ( ) ;
305- expect ( fetchHeaders ( ) ) . toMatchSnapshot ( ) ;
305+ const headers = fetchHeaders ( ) as Record < string , string > ;
306+ const normalizedHeaders = {
307+ ...headers ,
308+ 'User-Agent' : headers [ 'User-Agent' ] . replace ( / \( n o d e \/ v [ \d . ] + \) / , '(node/v18.0.0)' )
309+ } ;
310+ expect ( normalizedHeaders ) . toMatchSnapshot ( ) ;
306311 expect ( accessToken ) . toBe ( '01DMEK0J53CVMC32CK5SE0KZ8Q' ) ;
307312 expect ( profile ) . toMatchSnapshot ( ) ;
308313 } ) ;
@@ -342,7 +347,12 @@ describe('SSO', () => {
342347 expect ( fetch . mock . calls . length ) . toEqual ( 1 ) ;
343348
344349 expect ( fetchBody ( ) ) . toMatchSnapshot ( ) ;
345- expect ( fetchHeaders ( ) ) . toMatchSnapshot ( ) ;
350+ const headers = fetchHeaders ( ) as Record < string , string > ;
351+ const normalizedHeaders = {
352+ ...headers ,
353+ 'User-Agent' : headers [ 'User-Agent' ] . replace ( / \( n o d e \/ v [ \d . ] + \) / , '(node/v18.0.0)' )
354+ } ;
355+ expect ( normalizedHeaders ) . toMatchSnapshot ( ) ;
346356 expect ( accessToken ) . toBe ( '01DMEK0J53CVMC32CK5SE0KZ8Q' ) ;
347357 expect ( profile ) . toMatchSnapshot ( ) ;
348358 } ) ;
You can’t perform that action at this time.
0 commit comments