You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If maxRetryAfter is set to undefined, it will use options.timeout.
But is not working well in case of use extends
Actual behavior
Event if we use a timeout config like timeout: { request: 5000 }if don't provide a maxRetryAfter value when config is "normalized" the maxRetryAfter is being calculated as Infinity
Expected behavior
As per documentation maxRetryAfter should get 5000 as value.
Code to reproduce
const{ describe, it }=require('mocha')const{ strictEqual }=require('assert').strictconstGot=require('got')describe.only('default maxRetryAfter',function(){it('should get timeout value',asyncfunction(){constnewGot=Got.extend({timeout: {request: 5000}})strictEqual(newGot.defaults.options.retry.maxRetryAfter,5000)})})/**AssertionError[ERR_ASSERTION]: Expectedvaluestobe strictly equal:
Infinity!==5000/*
I think the problem is because the code to calculate default value for maxRetryAfter is in the method normalizeArguments() and is calculating the default value before the options are merged, for this reason get timeout as undefined and the maxRetryAfter is getting infinity value
The text was updated successfully, but these errors were encountered:
jolivaSan
changed the title
maxRetryAfter don't
default maxRetryAfter is not calculated correctly
Mar 12, 2021
Describe the bug
In got documentation sais
But is not working well in case of use extends
Actual behavior
Event if we use a timeout config like
timeout: { request: 5000 }
if don't provide amaxRetryAfter
value when config is "normalized" the maxRetryAfter is being calculated asInfinity
Expected behavior
As per documentation
maxRetryAfter
should get5000
as value.Code to reproduce
I think the problem is because the code to calculate default value for
maxRetryAfter
is in the methodnormalizeArguments()
and is calculating the default value before the options are merged, for this reason get timeout as undefined and themaxRetryAfter
is getting infinity valueThe text was updated successfully, but these errors were encountered: