Copyright | (c) Frederick Pringle 2025 |
---|---|
License | BSD-3-Clause |
Maintainer | frederick.pringle@fpringle.com |
Safe Haskell | None |
Language | Haskell2010 |
Servant.API.Routes.Golden
Description
The HasRoutes
class allows us to generate a list of Route
s from a Servant
API type. Using "hspec-golden", we can generate automatic Golden
tests from
these APIs. If such a test fails, we know that the shape of our API has changed.
Therefore we must either:
- decide that the shape change is correct, and acknowledge that the golden files should be updated, by running the hgold CLI, or
- realise that our changes resulted in a change to the API which we didn't intend/anticipate, so we have to fix them.
Synopsis
- goldenRoutes :: HasRoutes api => String -> Golden Value
- goldenRoutesSpec :: HasRoutes api => String -> Spec