File tree 1 file changed +9
-2
lines changed
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==
578
578
it ( "options.request.signal is passed as option to fetch" , function ( ) {
579
579
return request ( "/" , {
580
580
request : {
581
+ // We pass a value that is not an `AbortSignal`, and expect `fetch` to
582
+ // throw an exception complaining about the value
581
583
signal : "funk" ,
582
584
} ,
583
585
} )
@@ -586,8 +588,13 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
586
588
} )
587
589
588
590
. 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 / ) ;
591
598
} ) ;
592
599
} ) ;
593
600
You can’t perform that action at this time.
0 commit comments