Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
assertNotEq :: (HasCallStack, Eq a, Show a) => String -> a -> a -> YesodExample site ()yesod-test Yesod.Test Asserts that the two given values are not equal. In case they are equal, the error message includes the values.
bodyEquals :: HasCallStack => String -> YesodExample site ()yesod-test Yesod.Test Assert the last response is exactly equal to the given text. This is useful for testing API responses.
Examples
get HomeR bodyEquals "<html><body><h1>Hello, World</h1></body></html>"
getRequestCookies :: HasCallStack => RequestBuilder site Cookiesyesod-test Yesod.Test Returns the Cookies from the most recent request. If a request hasn't been made, an error is raised.
Examples
request $ do cookies <- getRequestCookies liftIO $ putStrLn $ "Cookies are: " ++ show cookies
Since 1.4.3.2request :: RequestBuilder site () -> YesodExample site ()yesod-test Yesod.Test The general interface for performing requests. request takes a RequestBuilder, constructs a request, and executes it. The RequestBuilder allows you to build up attributes of the request, like the headers, parameters, and URL of the request.
Examples
request $ do addToken byLabel "First Name" "Felipe" setMethod "PUT" setUrl NameR
requireJSONResponse :: (HasCallStack, FromJSON a) => YesodExample site ayesod-test Yesod.Test Parses the response body from JSON into a Haskell value, throwing an error if parsing fails. This function also checks that the Content-Type of the response is application/json.
Examples
get CommentR (comment :: Comment) <- requireJSONResponse
post UserR (json :: Value) <- requireJSONResponse
setRequestBody :: ByteString -> RequestBuilder site ()yesod-test Yesod.Test Simple way to set HTTP request body
Examples
request $ do setRequestBody "foobar"
import Data.Aeson request $ do setRequestBody $ encode $ object ["age" .= (1 :: Integer)]
ByAttrEquals :: Text -> Text -> Selectoryesod-test Yesod.Test.CssQuery No documentation available.
parseQuery :: Text -> Either String [[SelectorGroup]]yesod-test Yesod.Test.CssQuery Parses a query into an intermediate format which is easy to feed to HXT
- The top-level lists represent the top level comma separated queries.
- SelectorGroup is a group of qualifiers which are separated with spaces or > like these three: table.main.odd tr.even > td.big
- A SelectorGroup as a list of Selector items, following the above example the selectors in the group are: table, .main and .odd
ByAttrEquals :: Text -> Text -> Selectoryesod-test Yesod.Test.TransversingCSS No documentation available.
parseQuery :: Text -> Either String [[SelectorGroup]]yesod-test Yesod.Test.TransversingCSS Parses a query into an intermediate format which is easy to feed to HXT
- The top-level lists represent the top level comma separated queries.
- SelectorGroup is a group of qualifiers which are separated with spaces or > like these three: table.main.odd tr.even > td.big
- A SelectorGroup as a list of Selector items, following the above example the selectors in the group are: table, .main and .odd