forked from OSS/graphql
Eugen Wissner
c9e265f72c
An error can have multiple locations which are returned in a listt with key "locations".
21 lines
590 B
Haskell
21 lines
590 B
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
module Language.GraphQL.ErrorSpec
|
|
( spec
|
|
) where
|
|
|
|
import qualified Data.Aeson as Aeson
|
|
import qualified Data.Sequence as Seq
|
|
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''
|
|
in singleError "Message." `shouldBe` expected
|