File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
resolver : lts-20.10
2
2
3
3
extra-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
5
5
- url : https://github.com/codewars/hspec-codewars/archive/v0.1.0.tar.gz
6
6
7
7
# 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
5
2
6
3
import 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
7
9
8
10
main :: 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