@@ -9,7 +9,7 @@
9module Servant.JSSpec where
9module Servant.JSSpec where
11import Data.Either (isRight)
11import Data.Either (isRight)
12−import Data.Monoid ((<>))
12+import Data.Monoid ((<>), mconcat)
13import Data.Proxy
13import Data.Proxy
14import Data.Text (Text)
14import Data.Text (Text)
15import qualified Data.Text as T
15import qualified Data.Text as T
@@ -176,7 +176,7 @@ generateJSSpec n gen = describe specLabel $ do
176 jsText `shouldContain` (header n "X-WhatsForDinner" $ "\"I would like \" + headerXWhatsForDinner + \" with a cherry on top.\"")
176 jsText `shouldContain` (header n "X-WhatsForDinner" $ "\"I would like \" + headerXWhatsForDinner + \" with a cherry on top.\"")
178 it "can generate the whole javascript code string at once with jsForAPI" $ do
178 it "can generate the whole javascript code string at once with jsForAPI" $ do
179− let jsStr = jsForAPI (Proxy :: Proxy TestAPI) (concatMap gen)
179+ let jsStr = jsForAPI (Proxy :: Proxy TestAPI) (mconcat . map gen)
180 parseFromText jsStr `shouldSatisfy` isRight
180 parseFromText jsStr `shouldSatisfy` isRight
182 specLabel = "generateJS(" <> (show n) <> ")"
182 specLabel = "generateJS(" <> (show n) <> ")"