git.iko.soy/servant-quickcheck
on 6e727b6 help sign in
52 lines 1.5 kB history raw
1-- | @Servant.QuickCheck@ provides utilities related to using QuickCheck over an API.
2-- Rather than specifying properties that individual handlers must satisfy,
3-- you can state properties that ought to hold true of the entire API.
4--
5-- While the API must be described with @servant@ types, the server being
6-- tested itself need not be implemented with @servant-server@ (or indeed,
7-- written in Haskell).
8--
9module Servant.QuickCheck
10 (
13 -- * Test setup helpers
14 -- | Helpers to setup and teardown @servant@ servers during tests.
15 withServantServer
18 -- * Equality testing
19 , serversEqual
20 -- ** Response equality
21 -- | Often the normal equality of responses is not what we want. For example,
22 -- if responses contain a @Date@ header with the time of the response,
23 -- responses will fail to be equal even though they morally are. This datatype
24 -- represents other means of checking equality
25 -- *** Useful @ResponseEquality@s
26 , bodyEquality
27 , allEquality
28 -- ** Response equality type
29 , ResponseEquality(..)
31 -- * Property testing
32 , serverSatisfies
33 -- ** Predicates
34 -- *** Useful predicates
35 , not500
36 , onlyJsonObjects
37 , notAllowedContainsAllowHeader
38 -- *** Predicate utilities and types
39 , (<%>)
40 , Predicates
41 , ResponsePredicate(..)
42 , RequestPredicate(..)
44 -- ** Re-exports
45 , BaseUrl(..)
46 , Scheme(..)
49 ) where
51import Servant.QuickCheck.Internal
52import Servant.Client (BaseUrl(..), Scheme(..))