mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-25 16:36:31 +03:00
b24b12b2e6
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5304 GitOrigin-RevId: 8238c1b59c378b7fe37ae0c9afecbf04f8841e2e
18 lines
727 B
Haskell
18 lines
727 B
Haskell
module Test.HealthSpec (spec) where
|
|
|
|
import Hasura.Backends.DataConnector.API (Config, Routes (..), SourceName)
|
|
import Servant.API (NamedRoutes, NoContent (..))
|
|
import Servant.Client (Client, (//))
|
|
import Test.Hspec (Spec, describe, it, shouldBe)
|
|
import Prelude
|
|
|
|
spec :: Client IO (NamedRoutes Routes) -> SourceName -> Config -> Spec
|
|
spec api sourceName config = describe "health API" $ do
|
|
it "returns a successful HTTP status code for a plain healthcheck" $ do
|
|
response <- (api // _health) Nothing Nothing
|
|
response `shouldBe` NoContent
|
|
|
|
it "returns a successful HTTP status code for a data source healthcheck" $ do
|
|
response <- (api // _health) (Just sourceName) (Just config)
|
|
response `shouldBe` NoContent
|