Description
Hspec hook that unwraps test failures from AnnotatedException.
Description
An hspec hook that lets hspec catch and pretty-print HUnitFailure, the exception that is thrown when a test assertion fails, in the correct way even if it is wrapped in AnnotatedException.
README.md
haskell-library-template
When using hspec to test a project that uses annotated-exception, an AnnotatedException
thrown by the code under test does not display well in Hspec's output. hspec-annotated-exception
fixes this.
To use this package with Hspec module auto-discovery:
module SpecHook (hook) where
import Test.Hspec (Spec)
import Test.Hspec.AnnotatedException (unwrapAnnotatedHUnitFailure)
hook :: Spec -> Spec
hook = unwrapAnnotatedHUnitFailure