tests
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.API.ServerSpec

Synopsis

Documentation

spec :: Spec Source #

sendsAnErrorWhenInputCannotBeDecoded :: PortNumber -> Expectation Source #

isGreetings :: ServerOutput tx -> Bool Source #

waitForClients :: (MonadSTM m, Ord a, Num a) => TVar m a -> m () Source #

testClient :: TQueue IO (ServerOutput SimpleTx) -> TVar IO Int -> Connection -> IO () Source #

allowEverythingServerOutputFilter :: ServerOutputFilter tx Source #

noop :: Applicative m => a -> m () Source #

withTestAPIServer :: PortNumber -> Party -> PersistenceIncremental (TimedServerOutput SimpleTx) IO -> Tracer IO APIServerLog -> (Server SimpleTx IO -> IO ()) -> IO () Source #

withClient :: PortNumber -> String -> (Connection -> IO ()) -> IO () Source #

Connect to a websocket server running at given path. Fails if not connected within 2 seconds.

mockPersistence :: Applicative m => PersistenceIncremental a m Source #

Mocked persistence handle which just does nothing.

mockPersistence' :: Applicative m => [a] -> PersistenceIncremental a m Source #

Mocked persistence which does not contain some constant elements.

waitForValue :: HasCallStack => PortNumber -> (Value -> Maybe ()) -> IO () Source #

waitMatch :: HasCallStack => Natural -> Connection -> (Value -> Maybe a) -> IO a Source #

Wait up to some time for an API server output to match the given predicate.

shouldSatisfyAll :: Show a => [a] -> [a -> Bool] -> Expectation Source #