diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-07-19 07:36:06 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-07-19 07:36:06 +0200 |
| commit | b9d5b1fb1bdf634137f463186585bc51e540353b (patch) | |
| tree | 26b37de5a9f6592e8faaf97c11050c3661e734bf /tests/Test/RootOperationSpec.hs | |
| parent | 09135c581aaae471f7d964bc2a3a141bef299097 (diff) | |
| download | graphql-b9d5b1fb1bdf634137f463186585bc51e540353b.tar.gz | |
Return a stream as well from graphql* functions
Diffstat (limited to 'tests/Test/RootOperationSpec.hs')
| -rw-r--r-- | tests/Test/RootOperationSpec.hs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/Test/RootOperationSpec.hs b/tests/Test/RootOperationSpec.hs index 621d496..ea89279 100644 --- a/tests/Test/RootOperationSpec.hs +++ b/tests/Test/RootOperationSpec.hs @@ -11,10 +11,11 @@ module Test.RootOperationSpec import Data.Aeson ((.=), object) import qualified Data.HashMap.Strict as HashMap import Language.GraphQL -import Test.Hspec (Spec, describe, it, shouldBe) +import Test.Hspec (Spec, describe, it) import Text.RawString.QQ (r) import Language.GraphQL.Type import qualified Language.GraphQL.Type.Out as Out +import Test.Hspec.GraphQL hatType :: Out.ObjectType IO hatType = Out.ObjectType "Hat" Nothing [] @@ -50,15 +51,14 @@ spec = } } |] - expected = object - [ "data" .= object + expected = HashMap.singleton "data" + $ object [ "garment" .= object [ "circumference" .= (60 :: Int) ] ] - ] actual <- graphql schema querySource - actual `shouldBe` expected + actual `shouldResolveTo` expected it "chooses Mutation" $ do let querySource = [r| @@ -66,10 +66,9 @@ spec = incrementCircumference } |] - expected = object - [ "data" .= object + expected = HashMap.singleton "data" + $ object [ "incrementCircumference" .= (61 :: Int) ] - ] actual <- graphql schema querySource - actual `shouldBe` expected + actual `shouldResolveTo` expected |
