@@ -368,7 +368,7 @@ export class Page extends ChannelOwner<channels.PageChannel, channels.PageInitia
368
368
return urlOrPredicate ( request ) ;
369
369
} ;
370
370
const trimmedUrl = trimUrl ( urlOrPredicate ) ;
371
- const logLine = trimmedUrl ? `waiting for request " ${ trimmedUrl } " ` : undefined ;
371
+ const logLine = trimmedUrl ? `waiting for request ${ trimmedUrl } ` : undefined ;
372
372
return this . _waitForEvent ( Events . Page . Request , { predicate, timeout : options . timeout } , logLine ) ;
373
373
} ) ;
374
374
}
@@ -381,7 +381,7 @@ export class Page extends ChannelOwner<channels.PageChannel, channels.PageInitia
381
381
return urlOrPredicate ( response ) ;
382
382
} ;
383
383
const trimmedUrl = trimUrl ( urlOrPredicate ) ;
384
- const logLine = trimmedUrl ? `waiting for response " ${ trimmedUrl } " ` : undefined ;
384
+ const logLine = trimmedUrl ? `waiting for response ${ trimmedUrl } ` : undefined ;
385
385
return this . _waitForEvent ( Events . Page . Response , { predicate, timeout : options . timeout } , logLine ) ;
386
386
} ) ;
387
387
}
@@ -699,10 +699,15 @@ export class BindingCall extends ChannelOwner<channels.BindingCallChannel, chann
699
699
}
700
700
}
701
701
702
+ function trimEnd ( s : string ) : string {
703
+ if ( s . length > 50 )
704
+ s = s . substring ( 0 , 50 ) + '\u2026' ;
705
+ return s ;
706
+ }
707
+
702
708
function trimUrl ( param : any ) : string | undefined {
703
- if ( isString ( param ) ) {
704
- if ( param . length > 50 )
705
- param = param . substring ( 0 , 50 ) + '\u2026' ;
706
- return param ;
707
- }
709
+ if ( isRegExp ( param ) )
710
+ return `/${ trimEnd ( param . source ) } /${ param . flags } ` ;
711
+ if ( isString ( param ) )
712
+ return `"${ trimEnd ( param ) } "` ;
708
713
}
0 commit comments