graphql/tests/Language/GraphQL/ErrorSpec.hs

21 lines
590 B
Haskell
Raw Normal View History

2019-07-23 06:04:33 +02:00
{-# LANGUAGE OverloadedStrings #-}
module Language.GraphQL.ErrorSpec
( spec
) where
import qualified Data.Aeson as Aeson
import qualified Data.Sequence as Seq
2019-07-23 06:04:33 +02:00
import Language.GraphQL.Error
import Test.Hspec ( Spec
, describe
, it
, shouldBe
)
spec :: Spec
spec = describe "singleError" $
it "constructs an error with the given message" $
let errors'' = Seq.singleton $ Error "Message." []
expected = Response Aeson.Null errors''
2019-07-23 06:04:33 +02:00
in singleError "Message." `shouldBe` expected