add a test for jsForAPI
commitb09e2bf9da8fbb5d51859558ed1aa3dbf477b4dd
authorAlp Mestanogullari <alpmestan@gmail.com>
dateSun 19 Apr 2015, 11:56 (11 years ago)
parent21b6e96
servant-jquery.cabal+1−1
@@ -74,5 +74,5 @@ test-suite spec
7474 , servant
7575 , hspec >= 2.0
7676 , hspec-expectations
77− , language-ecmascript == 0.16.*
77+ , language-ecmascript >= 0.16
7878 default-language: Haskell2010
test/Servant/JQuerySpec.hs+4
@@ -90,3 +90,7 @@ generateJSSpec = describe "generateJS" $ do
9090 parseFromString jsText `shouldSatisfy` isRight
9191 jsText `shouldContain` "headerXWhatsForDinner"
9292 jsText `shouldContain` "headers: { \"X-WhatsForDinner\": \"I would like \" + headerXWhatsForDinner + \" with a cherry on top.\" }\n"
93+
94+ it "can generate the whole javascript code string at once with jsForAPI" $ do
95+ let jsStr = jsForAPI (Proxy :: Proxy TestAPI)
96+ parseFromString jsStr `shouldSatisfy` isRight