not really known
Go to file
Julian K. Arni 64c845cb45 Slightly nicer RequestPredicate.
Which still isn't beautiful.
2016-04-30 16:25:54 +02:00
doc Fix overlapping issues and improve tutorial. 2016-04-22 17:25:35 +02:00
src/Servant Slightly nicer RequestPredicate. 2016-04-30 16:25:54 +02:00
test Better failure tests 2016-04-26 14:43:02 +02:00
.gitignore initial commit 2016-04-22 13:00:23 +02:00
.travis.yml disable docs 2016-04-23 19:25:59 +02: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 Lower base lower bound 2016-04-26 14:27:31 +02:00
Setup.hs initial commit 2016-04-22 13:00:23 +02:00
stack.yaml disable docs 2016-04-23 19:25:59 +02: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.