File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 11resolver : lts-20.10
22
33extra-deps :
4- - url : https://github.com/codewars/hspec-formatters-codewars/archive/v0.2.1 .tar.gz
4+ - url : https://github.com/codewars/hspec-formatters-codewars/archive/v0.3.0 .tar.gz
55 - url : https://github.com/codewars/hspec-codewars/archive/v0.1.0.tar.gz
66
77# Control whether we use the GHC we find on the path
Original file line number Diff line number Diff line change 1- module Main where
2-
3- import Test.Hspec.Runner
4- import Test.Hspec.Formatters.Codewars (codewars )
1+ module Main (main ) where
52
63import qualified Spec
4+ import System.Exit
5+ import Test.Hspec.Core.Formatters.V2 (formatException , formatterToFormat )
6+ import Test.Hspec.Core.Util (safeTry )
7+ import Test.Hspec.Formatters.Codewars (escapeLF , newFormatter )
8+ import Test.Hspec.Runner
79
810main :: IO ()
9- main = hspecWith defaultConfig {configFormatter = Just codewars} Spec. spec
11+ main = do
12+ codewars <- newFormatter
13+ summary <- safeTry $ runSpec Spec. spec defaultConfig {configFormat = Just $ formatterToFormat codewars}
14+ case summary of
15+ Left ex -> do
16+ putStrLn $ " \n <ERROR::>Test suite crashed<:LF:>" ++ (escapeLF $ formatException ex)
17+ exitFailure
18+ Right s -> evaluateSummary s
You can’t perform that action at this time.
0 commit comments