Hoogle Search

Within LTS Haskell 24.67 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. assertEq :: (HasCallStack, Eq a, Show a) => String -> a -> a -> YesodExample site ()

    yesod-test Yesod.Test

    Asserts that the two given values are equal. In case they are not equal, the error message includes the two values.

  2. assertEqual :: (HasCallStack, Eq a) => String -> a -> a -> YesodExample site ()

    yesod-test Yesod.Test

    Deprecated: Use assertEq instead

  3. assertEqualNoShow :: (HasCallStack, Eq a) => String -> a -> a -> YesodExample site ()

    yesod-test Yesod.Test

    Asserts that the two given values are equal.

  4. 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.

  5. 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>"
    

  6. getRequestCookies :: HasCallStack => RequestBuilder site Cookies

    yesod-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.2

  7. request :: 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
    

  8. requireJSONResponse :: (HasCallStack, FromJSON a) => YesodExample site a

    yesod-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
    

  9. 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)]
    

  10. ByAttrEquals :: Text -> Text -> Selector

    yesod-test Yesod.Test.CssQuery

    No documentation available.

Page 341 of many | Previous | Next