hspec-junit-formatter: A JUnit XML runner/formatter for hspec

[ library, mit, testing ] [ Propose Tags ]

Allows hspec tests to write JUnit XML output for parsing in various tools.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,,,,,,,,,,
Change log CHANGELOG.md
Dependencies base (>= && <5), conduit (>=1.3.1), containers (>=, directory (>=, exceptions (>=0.10.0), filepath (>=1.4.2), hspec-core (>=2.8.1), iso8601-time (>=0.1.5), text (>=, time (>=, xml-conduit (>=, xml-types (>=0.3.6) [details]
License MIT
Copyright 2021 Renaissance Learning Inc
Author Freckle R&D
Maintainer engineering@freckle.com
Category Testing
Home page https://github.com/freckle/hspec-junit-formatter#readme
Bug tracker https://github.com/freckle/hspec-junit-formatter/issues
Source repo head: git clone https://github.com/freckle/hspec-junit-formatter
Uploaded by PatrickBrisbin at 2022-03-30T19:37:51Z
Distributions LTSHaskell:, Stackage:
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2667 total (45 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-03-30 [all 1 reports]

Readme for hspec-junit-formatter-

[back to package description]


A JUnit XML runner/formatter for hspec.


import Test.Hspec
import Test.Hspec.JUnit
import System.Environment (setEnv)

main :: IO ()
main = do
  -- Most likely done in your CI setup
  setEnv "JUNIT_ENABLED" "1"
  setEnv "JUNIT_SUITE_NAME" "my-tests"

  hspecJUnit spec

spec :: Spec
spec = describe "Addition" $ do
  it "adds" $ do
    2 + 2 `shouldBe` (4 :: Int)