http-mock-0.1.0.0: HTTP mocking and expectations library for Haskell

Copyright(c) 2019 Fernando Rincon Martin
LicenseApache-2.0
MaintainerFernando Rincon <f.rincon@protonmail.com>
Safe HaskellNone
LanguageHaskell2010

Network.HTTP.Mock

Contents

Description

This module provides tools for testing http clients agains a mocked API.

Currently the support is very basic, and is only limited to the withMockedManager, wich, passing a Wai Application 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.

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

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