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'm not sure exactly how this would work but it would be nice if the logs were available for a Success result and not just for a Failure.
The first case where I wanted them was when trying to integrate with ScalaMock. ScalaMock has a pretty awkward trait that has to be used to verify expectations. The only way to use this is to run the Hedgehog test to get the Report and then ScalaMock verifies the expectations. If an expectation fails we fail the test but there is no way to show what the generated values were as the report does not contain them.
The second time I wanted them was when trying to write a helper method that would negate an arbitrary Result. While that on its own is possible it won't be very good because the values are unknown. Even if they were it would be hard to write a very good log message but it would be possible to do something at least.
The text was updated successfully, but these errors were encountered:
I'm not sure exactly how this would work but it would be nice if the logs were available for a Success result and not just for a Failure.
Yeah I've been on the fence on this for a while, and I'm not surprised someone is asking for it (your example makes sense). Technically it's easy to do, and I'm happy to make the change, unless you get to it first. It's actually what the haskell version does, I don't really know why I did something different.
Just curious, are you also talking about outputting the (successful) logs on a failed test, or just tracking them for integrations/functions?
Result.all(List(
(1 === 1).log("would we see this?")
, (1 === 2)
))
Just curious, are you also talking about outputting the (successful) logs on a failed test, or just tracking them for integrations/functions?
That's a good question.
I think for backwards compatibility it would have to be just for tracking but I can see it being useful to have the option of outputting the successful logs too. Maybe something like:
Result.all(List(
(1 === 1).log("we won't see this")
(1 === 1).debug("but we will see this")
, (1 === 2)
))
I'm not sure exactly how this would work but it would be nice if the logs were available for a
Success
result and not just for aFailure
.The first case where I wanted them was when trying to integrate with ScalaMock. ScalaMock has a pretty awkward trait that has to be used to verify expectations. The only way to use this is to run the Hedgehog test to get the
Report
and then ScalaMock verifies the expectations. If an expectation fails we fail the test but there is no way to show what the generated values were as the report does not contain them.The second time I wanted them was when trying to write a helper method that would negate an arbitrary
Result
. While that on its own is possible it won't be very good because the values are unknown. Even if they were it would be hard to write a very good log message but it would be possible to do something at least.The text was updated successfully, but these errors were encountered: