resonate
resonate copied to clipboard
add strict flag for assert
Addresses Issue
Thank you so much @susarlanikhilesh 🎉 🎉
The tests are failing because some of our tests expect a panic to occur, and if the flag is not set (eg: the code is run via a test rather than cli) I believe viper is returning the default boolean value of false
. Is there a way to check if the flag is not set and, if not, set strict to true instead?
Yes the strict flag is false, I did set when panic is true in the test cases
I would prefer for strict=true
in cases where not explicitly set. Our philosophy here is to panic by default when an unexpected event occurs, this way we can protect ourselves from being in an invalid state.
viper.GetBool("strict") // if not set needs to be defaulted to true
An easier way to do it might be to invert the name of the flag to something like ignore-asserts
that we can default to false which makes things a little easier to implement.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 55.35%. Comparing base (
9f31bbe
) to head (097d546
). Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #329 +/- ##
=======================================
Coverage 55.34% 55.35%
=======================================
Files 113 113
Lines 9885 9886 +1
=======================================
+ Hits 5471 5472 +1
Misses 4052 4052
Partials 362 362
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.