mirror of
https://github.com/ilyakooo0/roboservant.git
synced 2024-08-16 03:20:44 +03:00
docs
This commit is contained in:
parent
8942fc5fe4
commit
c338551b07
15
EXAMPLE.md
15
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
|
||||
|
Loading…
Reference in New Issue
Block a user