wai-extra-3.0.29.2: Provides some basic WAI handlers and middleware.
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Test

Synopsis

Session

type Session = ReaderT Application (StateT ClientState IO) Source #

runSession :: Session a -> Application -> IO a Source #

See also: runSessionWith.

Client Cookies

type ClientCookies = Map ByteString SetCookie Source #

Since 3.0.6

setClientCookie :: SetCookie -> Session () Source #

Since 3.0.6

deleteClientCookie :: ByteString -> Session () Source #

Since 3.0.6

Requests

srequest :: SRequest -> Session SResponse Source #

Similar to request, but allows setting the request body as a plain ByteString.

data SRequest Source #

Constructors

SRequest 

Fields

data SResponse Source #

Constructors

SResponse 

Fields

Instances

Instances details
Eq SResponse Source # 
Instance details

Defined in Network.Wai.Test

Methods

(==) :: SResponse -> SResponse -> Bool

(/=) :: SResponse -> SResponse -> Bool

Show SResponse Source # 
Instance details

Defined in Network.Wai.Test

Methods

showsPrec :: Int -> SResponse -> ShowS

show :: SResponse -> String

showList :: [SResponse] -> ShowS

defaultRequest :: Request #

setPath :: Request -> ByteString -> Request Source #

Set whole path (request path + query string).

setRawPathInfo :: Request -> ByteString -> Request Source #

Assertions

assertContentType :: ByteString -> SResponse -> Session () Source #

assertBody :: ByteString -> SResponse -> Session () Source #

assertHeader :: CI ByteString -> ByteString -> SResponse -> Session () Source #

assertNoHeader :: CI ByteString -> SResponse -> Session () Source #

assertClientCookieExists :: String -> ByteString -> Session () Source #

Since 3.0.6

assertNoClientCookieExists :: String -> ByteString -> Session () Source #

Since 3.0.6

assertClientCookieValue :: String -> ByteString -> ByteString -> Session () Source #

Since 3.0.6

data WaiTestFailure Source #

Constructors

WaiTestFailure String 

Instances

Instances details
Eq WaiTestFailure Source # 
Instance details

Defined in Network.Wai.Test

Show WaiTestFailure Source # 
Instance details

Defined in Network.Wai.Test

Methods

showsPrec :: Int -> WaiTestFailure -> ShowS

show :: WaiTestFailure -> String

showList :: [WaiTestFailure] -> ShowS

Exception WaiTestFailure Source # 
Instance details

Defined in Network.Wai.Test

Methods

toException :: WaiTestFailure -> SomeException

fromException :: SomeException -> Maybe WaiTestFailure

displayException :: WaiTestFailure -> String