Data structure for carrying around the info needed to build and run a test.
Constructors
S Application TestName (Session ())
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Moduletasty-wai-0.1.2.0Haskell2010
Types and functions for testing wai endpoints using the tasty testing framework.
Data structure for carrying around the info needed to build and run a test.
S Application TestName (Session ())Run a test case against a Application.
This module re-exports the functions from 'wai-extra' for constructing the Session that is executed against a given endpoint.
A small test case may look like:
import MyApp (app)
testWai app "List Topics" $ do
res <- get "fudge/view"
assertStatus' HTTP.status200 res
Submit a GET request to the provided endpoint.
Submit a HEAD request to the provided endpoint.
Submit a POST request to the given endpoint with the provided ByteString as the body content.
Submit a PUT request to the given endpoint with the provided ByteString as the body content.
An alternative helper function for checking the status code on a response
that lets you use the functions from Network.HTTP.Types as opposed to bare
numbers.
Create an empty Request using the given HTTP Method and route.
As per buildRequest but requires body content.
As per buildRequestWithBody but allows for the setting of RequestHeaders.
See also: runSessionWith.
Set whole path (request path + query string).
A default, blank request.
SRequestsimpleRequest :: RequestsimpleRequestBody :: ByteStringRequest body that will override the one set in simpleRequest.
This is usually simpler than setting the body as a stateful IO-action in simpleRequest.
Similar to request, but allows setting the request body as a plain ByteString.
Since 3.0.6
Since 3.0.6
Since 3.0.6
Since 3.0.6
Since 3.0.6
Since 3.0.6
Since 3.0.6
Since 3.0.6
Synonym for 'flip runSession'