File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -325,14 +325,15 @@ test('support setting the signal as a default option', async t => {
325325 t . true ( signalHandlersRemoved ( ) , 'Abort signal event handlers not removed' ) ;
326326} ) ;
327327
328+ const timeoutErrorCode = 23 ;
328329// See https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static
329330test ( 'support AbortSignal.timeout()' , async t => {
330331 const signal = AbortSignal . timeout ( 1 ) ;
331332
332333 const p = got ( 'http://example.com' , { signal} ) ;
333334
334335 await t . throwsAsync ( p , {
335- code : 23 ,
336+ code : timeoutErrorCode ,
336337 message : 'The operation was aborted due to timeout' ,
337338 } ) ;
338339} ) ;
@@ -347,7 +348,7 @@ test('support AbortSignal.timeout() without user abort', async t => {
347348 const p = got ( 'http://example.com' , { signal} ) ;
348349
349350 await t . throwsAsync ( p , {
350- code : 23 ,
351+ code : timeoutErrorCode ,
351352 message : 'The operation was aborted due to timeout' ,
352353 } ) ;
353354
You can’t perform that action at this time.
0 commit comments