🚀 Feature: Make "slow" (by default) a function of "timeout" #3600
Labels
semver-major
implementation requires increase of "major" version number; "breaking changes"
status: wontfix
typically a feature which won't be added, or a "bug" which is actually intended behavior
type: discussion
debates, philosophy, navel-gazing, etc.
type: feature
enhancement proposal
I get sick of adjusting
slow
when adjustingtimeout
to avoid the warnings.Unless
slow
is set by the user, what if we made it a function of thetimeout
value?The current default values are 75ms for
slow
and 200ms fortimeout
. The function could be, then:(If there's a different function that makes more sense, that'd be cool too)
I propose:
--slow
, that's the value we use.--timeout
but no--slow
, we use the above function to determine the value ofslow
Runnable
. Meaning if we see athis.timeout(2000)
(but importantly, nothis.slow(x)
) in aRunnable
, then we adjust theslow
value using the function.this.slow(x)
in aRunnable
, we use that value, otherwise we revert to whatever's used in the parent context. If it's set explicitly viathis.slow(x)
in some parent context, use that; if it's set via--slow
do the same. If it's not set anywhere, use the function.An alternative:
slow
is less than 1, it's no longer in milliseconds; it's considered a percentage of the value oftimeout
. We could get away with shipping that in a minorThoughts? @mochajs/core
The text was updated successfully, but these errors were encountered: