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
{{ message }}
Repository navigation
A public function to modify the failure string of an Expectation #211
{-| A nice custom failure message for a failing expectation.Now if only there was a way to get rid of the "Given ..." :)-}customFailure:Expectation-> (String->String) ->ExpectationcustomFailure expectation failureString =case Test.Runner.getFailureReason expectation ofNothing->Expect.pass
Just{ description, reason }->Test.Runner.Failure.Extra.format description reason
|> failureString
|>Expect.fail
to use the nicely-formatted failure string, but wrap it in some explanations of its own.
This helper might be useful to others as well? Maybe it could live in this library, perhaps as mapFailureReason or something similar
Activity