Module
Node.Express.Test.Mock
- Package
- purescript-express
- Repository
- nkly/purescript-express
#MockResponse Source
type MockResponse = { cookies :: Object MockCookie, data :: String, headers :: Object String, statusCode :: Int }
#MockRequest Source
newtype MockRequest
Constructors
MockRequest { setBody :: Foreign -> MockRequest, setBodyParam :: String -> String -> MockRequest, setCookie :: String -> String -> MockRequest, setHeader :: String -> String -> MockRequest, setRouteParam :: String -> String -> MockRequest, setSignedCookie :: String -> String -> MockRequest }
#setRequestHeader Source
setRequestHeader :: String -> String -> MockRequest -> MockRequest
#setRouteParam Source
setRouteParam :: String -> String -> MockRequest -> MockRequest
#setBody Source
setBody :: String -> MockRequest -> MockRequest
#setBody' Source
setBody' :: Foreign -> MockRequest -> MockRequest
#setBodyParam Source
setBodyParam :: String -> String -> MockRequest -> MockRequest
#setRequestCookie Source
setRequestCookie :: String -> String -> MockRequest -> MockRequest
#setRequestSignedCookie Source
setRequestSignedCookie :: String -> String -> MockRequest -> MockRequest
#TestExpress Source
type TestExpress = Aff
#TestMockApp Source
type TestMockApp = ReaderT Application TestExpress Unit
#createMockRequest Source
createMockRequest :: String -> String -> Effect MockRequest
#testExpress Source
testExpress :: String -> TestMockApp -> TestSuite
#setupMockApp Source
setupMockApp :: TestApp -> TestMockApp
#sendRequest Source
sendRequest :: Method -> String -> (MockRequest -> MockRequest) -> (MockResponse -> TestMockApp) -> TestMockApp
#sendError Source
sendError :: Method -> String -> String -> (MockResponse -> TestMockApp) -> TestMockApp
#assertInApp Source
assertInApp :: (Reporter -> TestApp) -> TestMockApp
#assertStatusCode Source
assertStatusCode :: Int -> MockResponse -> TestMockApp
#assertHeader Source
assertHeader :: String -> Maybe String -> MockResponse -> TestMockApp
#assertData Source
assertData :: String -> MockResponse -> TestMockApp
#assertCookieValue Source
assertCookieValue :: String -> Maybe String -> MockResponse -> TestMockApp
#setTestHeader Source
setTestHeader :: String -> Handler
#assertTestHeader Source
assertTestHeader :: Maybe String -> MockResponse -> TestMockApp