From c338551b07c2d0c140ded075b0cbe2b55c13b94a Mon Sep 17 00:00:00 2001 From: Mark Wotton Date: Sun, 3 Jan 2021 11:52:12 -0500 Subject: [PATCH] docs --- EXAMPLE.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index 838f09c..2c252dc 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -50,11 +50,22 @@ In the test file, we first define the tests: the faulty server should fail and t ```haskell spec = describe "example" $ do it "good server should not fail" $ do - fuzz @Api goodServer defaultConfig { coverageThreshold = 0.99 } + fuzz @Api goodServer config >>= (`shouldSatisfy` isNothing) it "bad server should fail" $ do - fuzz @Api badServer defaultConfig { coverageThreshold = 0.99 } + fuzz @Api badServer config >>= (`shouldSatisfy` serverFailure) + +config = defaultConfig + { + -- we expect to be able to cover the api from our starting point: + -- this will fail the test if we don't. + coverageThreshold = 0.99 + } + +-- there are other tweakable things in the config, like maximum runtime, reps, +-- per-request healthchecks, and verbose logging. Have a look at +-- Roboservant.Types.Config for details. ``` And unless we want to ship roboservant and all its dependencies to production, we also need