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
thresholds hold the current configuration for the limits; if it is set to zero, then thresholds[key] || 100 evaluates to 100.
As I understand, the logic here is not to update when the value was not set in the configuration in the first place. ?? should be used instead of || as only undefined should become 100, and 0 should stay 0.
Reproduction
This is easy enough to understand without a reproduction repository.
Simple test on playcode https://playcode.io/1624061
Describe the bug
vitest/packages/vitest/src/utils/coverage.ts
Lines 32 to 38 in eac7776
thresholds hold the current configuration for the limits; if it is set to zero, then
thresholds[key] || 100
evaluates to100
.As I understand, the logic here is not to update when the value was not set in the configuration in the first place.
??
should be used instead of||
as only undefined should become 100, and 0 should stay 0.Reproduction
This is easy enough to understand without a reproduction repository.
Simple test on playcode https://playcode.io/1624061
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: