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
I noticed that there doesn't seem to be a way to mock non-string parameters; for example, I have a function that calculates a duration to be used as the TTL for PExpire and does not expose it such that I can use it in my test. This means I cannot mock cases that call this function since there is no way to know the TTL at the time of test execution.
We have regex matching or a custom matcher function that are supported for string arguments, but there doesn't seem to be a way to mock non-string parameters.
Example:
// The key can be matched with regex but not the durationmockConfig.Regexp().ExpectPExpire(`^[a-fA-F0-9]{32}/\d+$`, <someduration>).RedisNil()
The text was updated successfully, but these errors were encountered:
I noticed that there doesn't seem to be a way to mock non-string parameters; for example, I have a function that calculates a duration to be used as the TTL for
PExpire
and does not expose it such that I can use it in my test. This means I cannot mock cases that call this function since there is no way to know the TTL at the time of test execution.We have regex matching or a custom matcher function that are supported for string arguments, but there doesn't seem to be a way to mock non-string parameters.
Example:
The text was updated successfully, but these errors were encountered: