hspec-junit-formatter-1.1.1.0: A JUnit XML runner/formatter for hspec
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Hspec.JUnit.Formatter

Description

An Hspec formatter that produces a JUnit XML file of results

-- file test/SpecHook.hs
module SpecHook where

import Test.Hspec
import Test.Hspec.JUnit.Config
import Test.Hspec.JUnit.Formatter qualified as Formatter

-- | To only produce a JUnit file, silencing other output
hook :: Spec -> Spec
hook = Formatter.use defaultJUnitConfig

-- | To produce a JUnit file in addition to the normal output
hook :: Spec -> Spec
hook = Formatter.add defaultJUnitConfig

-- | To only produce, but only when --format=junit is used
hook :: Spec -> Spec
hook = Formatter.register defaultJUnitConfig

See also,

For a version that reads configuration from JUNIT_ environment variables, see Test.Hspec.JUnit.Formatter.Env.

Synopsis

Documentation

use :: JUnitConfig -> SpecWith a -> SpecWith a Source #

Register junit as an available formatter and use it by default

add :: JUnitConfig -> SpecWith a -> SpecWith a Source #

Register junit, and use it in addition to the default

register :: JUnitConfig -> SpecWith a -> SpecWith a Source #

Register junit, but do not change the default