Skip to content
Permalink
Browse files

fully evaluate errors on unexpected network failure to trigger coverage

  • Loading branch information...
KtorZ authored and Anviking committed Jun 14, 2019
1 parent 0dfe29d commit cbae161d80002eb38cbac3c6a5c5986e5f49dc93
@@ -117,6 +117,7 @@ test-suite integration
, cardano-wallet-core
, cardano-wallet-jormungandr
, cardano-wallet-launcher
, deepseq
, directory
, hspec
, QuickCheck
@@ -33,6 +33,8 @@ import Control.Concurrent
( threadDelay )
import Control.Concurrent.Async
( Async, async, cancel )
import Control.DeepSeq
( deepseq )
import Control.Exception
( SomeException, bracket, catch )
import Control.Monad
@@ -118,8 +120,10 @@ spec = do
let action = do
res <- runExceptT $ networkTip nw
res `shouldSatisfy` \case
Left (ErrNetworkTipNetworkUnreachable _) -> True
_ -> error (msg res)
Left (ErrNetworkTipNetworkUnreachable e) ->
show e `deepseq` True
_ ->
error (msg res)
action `shouldReturn` ()

it "nextBlocks: ErrNetworkUnreachable" $ do
@@ -130,8 +134,10 @@ spec = do
let action = do
res <- runExceptT $ nextBlocks nw genesis
res `shouldSatisfy` \case
Left (ErrGetBlockNetworkUnreachable _) -> True
_ -> error (msg res)
Left (ErrGetBlockNetworkUnreachable e) ->
show e `deepseq` True
_ ->
error (msg res)
action `shouldReturn` ()

it "networkTip: throws on invalid url" $ do

0 comments on commit cbae161

Please sign in to comment.
You can’t perform that action at this time.