Hoogle Search
Within LTS Haskell 24.34 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
sydtest-yesod Test.Syd.Yesod Using a function that supplies a site, based on an inner resource, run a test suite.
yesodClientManager :: YesodClient site -> !Managersydtest-yesod Test.Syd.Yesod.Client The Manager to make the requests
yesodClientSite :: YesodClient site -> !sitesydtest-yesod Test.Syd.Yesod.Client The site itself
yesodClientSiteURI :: YesodClient site -> !URIsydtest-yesod Test.Syd.Yesod.Client The base URI that the site is running on
yesodClientStateCookies :: YesodClientState -> !CookieJarsydtest-yesod Test.Syd.Yesod.Client The cookies to pass along
yesodClientStateLast :: YesodClientState -> !Maybe (Request, Response ByteString)sydtest-yesod Test.Syd.Yesod.Client The last request and response pair
yesodClientSetupFunc :: YesodDispatch site => Manager -> site -> SetupFunc (YesodClient site)sydtest-yesod Test.Syd.Yesod.Def No documentation available.
-
sydtest-yesod Test.Syd.Yesod.Def No documentation available.
yesodSpec :: YesodDispatch site => site -> YesodSpec site -> Specsydtest-yesod Test.Syd.Yesod.Def Run a test suite using the given site. If your site contains any resources that need to be set up, you probably want to be using one of the following functions instead. Example usage with a minimal yesod App:
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Minimal where import Yesod import Test.Syd data App = App -- | Empty App type mkYesod "App" [parseRoutes| / HomeR GET |] instance Yesod App getHomeR :: Handler Html getHomeR = "Hello, world!" main :: IO () main = Yesod.warp 3000 App testMain :: IO () testMain = sydTest spec spec :: Spec spec = yesodSpec App $ do it "returns 200 on the homepage" $ do get HomeR statusIs 200This function exists for backward compatibility with yesod-test.yesodSpecWithSiteGenerator :: YesodDispatch site => IO site -> YesodSpec site -> Specsydtest-yesod Test.Syd.Yesod.Def Run a test suite using the given site generator. If your site contains any resources that you will want to have set up beforhand, you will probably want to use yesodSpecWithSiteGeneratorAndArgument or yesodSpecWithSiteSupplierWith instead. Example usage with a yesod App that contains a secret key that is generated at startup but not used during tests:
data Key = Key -- The implementation of the actual key is omitted here for brevity. genKey :: IO Key genKey = pure Key data App = App { appSecretKey :: Key } genApp :: IO App genApp = App <$> genKey main :: IO () main = sydTest spec spec :: Spec spec = yesodSpecWithSiteGenerator genApp $ do it "returns 200 on the homepage" $ do get HomeR statusIs 200This function exists for backward compatibility with yesod-test.