Copyright | (c) 2019 Fernando Rincon Martin |
---|---|
License | Apache-2.0 |
Maintainer | Fernando Rincon <f.rincon@protonmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
This module provides tools for testing http clients agains a mocked API.
Currently the support is very basic, and is only limited to the
,
wich, passing a Wai withMockedManager
and a function that accepts a http-client manager,
it will run the function passing a spcial manager who all the request to that manager
will be processed by the Application
passed as an argument.Application
Note that the current implementation uses Unix Domain sockets in order to serve all the request, so most probably the code will not work in windows.
Synopsis
- withMockedManager :: Application -> (Manager -> IO a) -> IO a
Mocking Functions
withMockedManager :: Application -> (Manager -> IO a) -> IO a Source #
Run a action passing a http client Manager
that uses the Application
as resolver for all requests