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]
Versions [RSS] [faq],,,,,,,,,,
Change log CHANGELOG.md
Dependencies base (>= && <5), conduit (>=, containers (>=, directory (>=, exceptions (>=0.10.4), filepath (>=, hspec-core (>=2.8.1), text (>=, time (>=1.9.3), xml-conduit (>=, xml-types (>=0.3.8) [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 2021-12-07T17:12:36Z
Distributions LTSHaskell:, NixOS:, Stackage:
Downloads 1438 total (33 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2021-12-07 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees


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)