HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehspec-api-2.11.14Haskell2010

Test.Hspec.Api.Formatters.V1

This module contains formatters that can be used with hspecWith:

import Test.Hspec
import Test.Hspec.Api.Formatters.V1

main :: IO ()
main = hspecWith (useFormatter ("my-formatter", formatter) defaultConfig) spec

formatter :: Formatter
formatter = ...

spec :: Spec
spec = ...
  • 9 types
  • 27 values

Register a formatter

2 declarations

Formatters

5 declarations

Implementing a custom Formatter

3 declarations

A formatter is a set of actions. Each action is evaluated when a certain situation is encountered during a test run.

Actions live in the FormatM monad. It provides access to the runner state and primitives for appending to the generated report.

Accessing the runner state

newtypenewtype Seconds
#

Constructors

Instances6Eq, Fractional, Num, Ord, Show, PrintfArg
  • Eq SecondsDefined in hspec-core-2.11.14 · Test.Hspec.Core.Clock
  • Fractional SecondsDefined in hspec-core-2.11.14 · Test.Hspec.Core.Clock
  • Num SecondsDefined in hspec-core-2.11.14 · Test.Hspec.Core.Clock
  • Ord SecondsDefined in hspec-core-2.11.14 · Test.Hspec.Core.Clock
  • Show SecondsDefined in hspec-core-2.11.14 · Test.Hspec.Core.Clock
  • PrintfArg SecondsDefined in hspec-core-2.11.14 · Test.Hspec.Core.Clock

Appending to the generated report

Dealing with colors

Helpers

Re-exports

5 declarations