Skip to content

Commit

Permalink
tests: Add DaedalusIPC test
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jun 12, 2019
1 parent bcc8705 commit 2960fde
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/core/test/integration/Test/Integration/Scenario/CLI/Server.hs
Expand Up @@ -13,9 +13,15 @@ import System.Exit
import System.IO.Temp
( withSystemTempDirectory )
import System.Process
( CreateProcess, proc, withCreateProcess )
( CreateProcess
, createProcess
, proc
, terminateProcess
, waitForProcess
, withCreateProcess
)
import Test.Hspec
( Spec, describe, it, shouldContain )
( Spec, describe, it, shouldContain, shouldReturn )

spec :: Spec
spec = do
Expand All @@ -31,6 +37,11 @@ spec = do
ls <- listDirectory d
ls `shouldContain` ["wallet.db"]

describe "DaedalusIPC" $ do
it "should reply with the port when asked" $ do
(_, _, _, ph) <- createProcess (proc "test/integration/js/mock-daedalus.js" [])
waitForProcess ph `shouldReturn` ExitSuccess

withTempDir :: (FilePath -> IO a) -> IO a
withTempDir = withSystemTempDirectory "integration-state"

Expand Down

0 comments on commit 2960fde

Please sign in to comment.