yesod-test-json-0.2.0.0: Utility functions for testing JSON web services written in Yesod

Safe HaskellSafe-Infered

Yesod.Test.Json

Description

Yesod.Test.Json provides convenience functions for working with Test.Hspec and Network.Wai.Test on JSON data.

Synopsis

Documentation

testApp :: Application -> AppConfig env extra -> (((APIFunction -> Session ()) -> Assertion) -> Spec) -> IO ()Source

Run a test suite for your Application

type APIFunctionSource

Arguments

 = ByteString

method

-> [Text]

path

-> Maybe Value 
-> Session SResponse 

A request to your server.

type Session = ReaderT Application (StateT ClientState IO)

type Assertion = IO ()

When an assertion is evaluated, it will output a message if and only if the assertion fails.

Test cases are composed of a sequence of one or more assertions.

module Test.Hspec

module Data.Aeson