minimistjs / minimist

parse argument options
MIT License
515 stars 30 forks source link

[patch]: test for boolean in setarg should include aliases #34

Closed shadowspawn closed 1 year ago

shadowspawn commented 1 year ago

The check for a boolean option when setting value should take into account aliases. Adding more for completeness and consistency than a practical concern, as especially after other similar bugs checking for aliases of boolean are fixed, this is less likely to come up in a real program!

Found by code inspection, not from usage.

I added a new test file to cover the main behaviours of the existing automatic array behaviour, and then tests related to the bug fix in this PR.

Fixes: #31

codecov-commenter commented 1 year ago

Codecov Report

Merging #34 (fdbb909) into main (de53490) will not change coverage. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main      #34   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files           1        1           
  Lines         165      165           
  Branches       70       70           
=======================================
  Hits          163      163           
  Misses          2        2           
Impacted Files Coverage Δ
index.js 98.78% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

shadowspawn commented 1 year ago

(Update: reworked test to follow the example used in #31, rather than use default for setup.)