mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-19 13:31:43 +03:00
3f405915e9
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4890 GitOrigin-RevId: 605408bddf03bef66eb03be8c242797e8fcf89bb
19 lines
766 B
Haskell
19 lines
766 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)
|
|
import Test.Hspec.Expectations.Pretty (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
|