@@ -65,7 +65,7 @@ customOptions = defCommonGeneratorOptions
6565 { successCallback = "okCallback"
6666 , errorCallback = "errorCallback"
6767 }
68−
68+
6969spec :: Spec
7070spec = describe "Servant.JQuery" $ do
7171 generateJSSpec Vanilla JS.generateVanillaJS
@@ -76,12 +76,12 @@ spec = describe "Servant.JQuery" $ do
7676 generateJSSpec AngularCustom (NG.generateAngularJSWith NG.defAngularOptions customOptions)
7777 generateJSSpec Axios (AX.generateAxiosJS AX.defAxiosOptions)
7878 generateJSSpec AxiosCustom (AX.generateAxiosJSWith (AX.defAxiosOptions { withCredentials = True }) customOptions)
79−
79+
8080 angularSpec Angular
8181 axiosSpec
8282 --angularSpec AngularCustom
8383
84−axiosSpec :: Spec
84+axiosSpec :: Spec
8585axiosSpec = describe specLabel $ do
8686 it "should add withCredentials when needed" $ do
8787 let jsText = genJS withCredOpts $ listFromAPI (Proxy :: Proxy TestAPI)
@@ -102,20 +102,20 @@ axiosSpec = describe specLabel $ do
102102 cookieOpts = AX.defAxiosOptions { AX.xsrfCookieName = Just "MyXSRFcookie" }
103103 headerOpts = AX.defAxiosOptions { AX.xsrfHeaderName = Just "MyXSRFheader" }
104104 genJS :: AxiosOptions -> [AjaxReq] -> String
105− genJS opts req = concat $ map (AX.generateAxiosJS opts) req
105+ genJS opts req = concatMap (AX.generateAxiosJS opts) req
106106
107−angularSpec :: TestNames -> Spec
107+angularSpec :: TestNames -> Spec
108108angularSpec test = describe specLabel $ do
109109 it "should implement a service globally" $ do
110110 let jsText = genJS $ listFromAPI (Proxy :: Proxy TestAPI)
111111 output jsText
112112 jsText `shouldContain` (".service('" ++ testName ++ "'")
113−
113+
114114 it "should depend on $http service globally" $ do
115115 let jsText = genJS $ listFromAPI (Proxy :: Proxy TestAPI)
116116 output jsText
117117 jsText `shouldContain` ("('" ++ testName ++ "', function($http) {")
118−
118+
119119 it "should not depend on $http service in handlers" $ do
120120 let jsText = genJS $ listFromAPI (Proxy :: Proxy TestAPI)
121121 output jsText
@@ -126,11 +126,11 @@ angularSpec test = describe specLabel $ do
126126 testName = "MyService"
127127 ngOpts = NG.defAngularOptions { NG.serviceName = testName }
128128 genJS req = NG.angularService ngOpts req
129−
129+
130130generateJSSpec :: TestNames -> (AjaxReq -> String) -> Spec
131131generateJSSpec n gen = describe specLabel $ do
132132 it "should generate valid javascript" $ do
133− let s = jsForAPI (Proxy :: Proxy TestAPI) (concat . map gen)
133+ let s = jsForAPI (Proxy :: Proxy TestAPI) (concatMap gen)
134134 parseFromString s `shouldSatisfy` isRight
135135
136136 it "should use non-empty function names" $ do
@@ -167,7 +167,7 @@ generateJSSpec n gen = describe specLabel $ do
167167 jsText `shouldContain` (header n "X-WhatsForDinner" $ "\"I would like \" + headerXWhatsForDinner + \" with a cherry on top.\"")
168168
169169 it "can generate the whole javascript code string at once with jsForAPI" $ do
170− let jsStr = jsForAPI (Proxy :: Proxy TestAPI) (concat . map gen)
170+ let jsStr = jsForAPI (Proxy :: Proxy TestAPI) (concatMap gen)
171171 parseFromString jsStr `shouldSatisfy` isRight
172172 where
173173 specLabel = "generateJS(" ++ (show n) ++ ")"