Copyright | (c) 2020-2021 Tim Emiola |
---|---|
License | BSD3 |
Maintainer | Tim Emiola <adetokunbo@users.noreply.github.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An demo Tasty
test that use tmp-proc
Synopsis
- dbProc :: TmpPostgres
- cacheProc :: TmpRedis
- testProcs :: HList '[TmpPostgres, TmpRedis]
- main :: IO ()
- tests :: IO Fixture -> TestTree
- hasInCache :: ServerHandle '[TmpPostgres, TmpRedis] -> ContactID -> IO Bool
- hasInDb :: ServerHandle '[TmpPostgres, TmpRedis] -> ContactID -> IO Bool
- type Fixture = (ServerHandle '[TmpPostgres, TmpRedis], ClientEnv)
- mkFixture :: IO Fixture
- shutdown' :: Fixture -> IO ()
- cacheLocFrom :: ProcHandle TmpRedis -> IO Locator
- clientEnvOf :: AreProcs procs => ServerHandle procs -> IO ClientEnv
- testContact :: Contact
Documentation
dbProc :: TmpPostgres Source #
The test uses a Postgres database .
testProcs :: HList '[TmpPostgres, TmpRedis] Source #
Specifies the procs to be launched as test fixtures.
hasInCache :: ServerHandle '[TmpPostgres, TmpRedis] -> ContactID -> IO Bool Source #
hasInDb :: ServerHandle '[TmpPostgres, TmpRedis] -> ContactID -> IO Bool Source #
type Fixture = (ServerHandle '[TmpPostgres, TmpRedis], ClientEnv) Source #
The full test fixture.
It allows tests to
- use the servant client to invoke the backend
- check the state of service backends via the
ProcHandles
in theServerHandle
.
cacheLocFrom :: ProcHandle TmpRedis -> IO Locator Source #
clientEnvOf :: AreProcs procs => ServerHandle procs -> IO ClientEnv Source #