File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -578,6 +578,8 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
578578 it ( "options.request.signal is passed as option to fetch" , function ( ) {
579579 return request ( "/" , {
580580 request : {
581+ // We pass a value that is not an `AbortSignal`, and expect `fetch` to
582+ // throw an exception complaining about the value
581583 signal : "funk" ,
582584 } ,
583585 } )
@@ -586,8 +588,13 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
586588 } )
587589
588590 . catch ( ( error ) => {
589- expect ( error . message ) . toMatch ( / \b s i g n a l \b / i) ;
590- expect ( error . message ) . toMatch ( / \b A b o r t S i g n a l \b / i) ;
591+ // We can't match on the entire string because the message differs between
592+ // Node versions.
593+ //
594+ // In v14 and v16, the message just mentions "signal" and has `instanceof`
595+ // as one word, whereas in v18 it contains the stringified signal and uses
596+ // proper English ("instance of").
597+ expect ( error . message ) . toMatch ( / t o b e a n i n s t a n c e ? o f A b o r t S i g n a l / ) ;
591598 } ) ;
592599 } ) ;
593600
You can’t perform that action at this time.
0 commit comments