Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- waiClientSpec :: Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result
- waiClientSpecWith :: IO Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result
- waiClientSpecWithSetupFunc :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM outers oldInner result
- waiClientSpecWithSetupFunc' :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM (Manager ': outers) oldInner result
- waiClientSetupFunc :: Manager -> Application -> env -> SetupFunc (WaiClient env)
- wit :: forall env e outers. (HasCallStack, IsTest (WaiClient env -> IO e), Arg1 (WaiClient env -> IO e) ~ (), Arg2 (WaiClient env -> IO e) ~ WaiClient env) => String -> WaiClientM env e -> TestDefM outers (WaiClient env) ()
- waiSpec :: Application -> TestDef outers PortNumber -> TestDef outers ()
- waiSpecWith :: (forall r. (Application -> IO r) -> IO r) -> TestDef outers PortNumber -> TestDef outers ()
- waiSpecWith' :: (forall r. (Application -> IO r) -> inner -> IO r) -> TestDef outers PortNumber -> TestDef outers inner
- waiSpecWithSetupFunc :: SetupFunc Application -> TestDef outers PortNumber -> TestDef outers ()
- waiSpecWithSetupFunc' :: (inner -> SetupFunc Application) -> TestDef outers PortNumber -> TestDef outers inner
- applicationSetupFunc :: Application -> SetupFunc PortNumber
- managerSpec :: TestDefM (Manager ': outers) inner result -> TestDefM outers inner result
Documentation
waiClientSpec :: Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result Source #
Run a given Application
around every test.
This provides a 'WaiClient ()' which contains the port of the running application.
waiClientSpecWith :: IO Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result Source #
Run a given Application
, as built by the given action, around every test.
waiClientSpecWithSetupFunc :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM outers oldInner result Source #
Run a given Application
, as built by the given SetupFunc
, around every test.
waiClientSpecWithSetupFunc' :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM (Manager ': outers) oldInner result Source #
Run a given Application
, as built by the given SetupFunc
, around every test.
This function doesn't set up the Manager
like waiClientSpecWithSetupFunc
does.
waiClientSetupFunc :: Manager -> Application -> env -> SetupFunc (WaiClient env) Source #
A SetupFunc
for a WaiClient
, given an Application
and user-defined env
.
wit :: forall env e outers. (HasCallStack, IsTest (WaiClient env -> IO e), Arg1 (WaiClient env -> IO e) ~ (), Arg2 (WaiClient env -> IO e) ~ WaiClient env) => String -> WaiClientM env e -> TestDefM outers (WaiClient env) () Source #
Define a test in the 'WaiClientM site' monad instead of IO
.
Example usage:
waiClientSpec exampleApplication $ do describe "/" $ do wit "works with a get" $ get "/" `shouldRespondWith` 200 wit "works with a post" $ post "/" `shouldRespondWith` ""
waiSpec :: Application -> TestDef outers PortNumber -> TestDef outers () Source #
Run a given Application
around every test.
This provides the port on which the application is running.
waiSpecWith :: (forall r. (Application -> IO r) -> IO r) -> TestDef outers PortNumber -> TestDef outers () Source #
Run a Application
around every test by setting it up with the given setup function.
This provides the port on which the application is running.
waiSpecWith' :: (forall r. (Application -> IO r) -> inner -> IO r) -> TestDef outers PortNumber -> TestDef outers inner Source #
Run a Application
around every test by setting it up with the given setup function that can take an argument.
a
This provides the port on which the application is running.
waiSpecWithSetupFunc :: SetupFunc Application -> TestDef outers PortNumber -> TestDef outers () Source #
Run a Application
around every test by setting it up with the given SetupFunc
.
a
This provides the port on which the application is running.
waiSpecWithSetupFunc' :: (inner -> SetupFunc Application) -> TestDef outers PortNumber -> TestDef outers inner Source #
Run a Application
around every test by setting it up with the given SetupFunc
and inner resource.
a
This provides the port on which the application is running.
applicationSetupFunc :: Application -> SetupFunc PortNumber Source #
A SetupFunc
to run an application and provide its port.