not really known
Go to file
Julian K. Arni 343f55f61a Removing GHC 7.8 support.
It never really existed.
2016-08-28 20:50:42 -03:00
doc docs 2016-07-18 16:12:21 -03:00
src/Servant Removing GHC 7.8 support. 2016-08-28 20:50:42 -03:00
test Cleanup 2016-08-28 19:22:43 -03:00
.gitignore docs 2016-07-18 16:12:21 -03:00
.travis.yml Removing GHC 7.8 support. 2016-08-28 20:50:42 -03:00
CHANGELOG.md Start changelog 2016-08-28 19:22:51 -03:00
LICENSE initial commit 2016-04-22 13:00:23 +02:00
README.md Add readme 2016-04-26 13:43:52 +02:00
servant-quickcheck.cabal Removing GHC 7.8 support. 2016-08-28 20:50:42 -03:00
Setup.hs initial commit 2016-04-22 13:00:23 +02:00
stack.yaml Cleanup 2016-08-28 20:23:32 -03:00

servant-quickcheck

servant-quickcheck provides tools to test properties across entire APIs. Rather than writing the same tests for each endpoint, with servant-quickcheck you can simply specify properties every endpoint must meet once and for all. For example:

followsBestPractices :: Spec
followsBestPractices = describe "my API" $ do

  it "follows best practices" $ do
    withServantServer myAPI myServer $ \burl ->
      serverSatisfies api burl stdArgs
           ( not500
         <%> onlyJsonObjects
         <%> getsHaveCacheControlHeader
         <%> headsHaveCacheControlHeader
         <%> mempty)

Additionally, servant-quickcheck provides a serversEqual function that generates arbitrary requests (that conform to the description of an API) and tests that two servers respond identically to them. This can be useful when refactoring or rewriting an API that should not change.