servant-js testsuite code cleanup
This commit is contained in:
parent
6257712687
commit
d3fa61c041
1 changed files with 8 additions and 10 deletions
|
@ -65,15 +65,15 @@ customOptions = defCommonGeneratorOptions {
|
||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = describe "Servant.JQuery" $ do
|
spec = describe "Servant.JQuery" $ do
|
||||||
(generateJSSpec Vanilla JS.generateVanillaJS)
|
generateJSSpec Vanilla JS.generateVanillaJS
|
||||||
(generateJSSpec VanillaCustom $ JS.generateVanillaJSWith customOptions)
|
generateJSSpec VanillaCustom (JS.generateVanillaJSWith customOptions)
|
||||||
(generateJSSpec JQuery JQ.generateJQueryJS)
|
generateJSSpec JQuery JQ.generateJQueryJS
|
||||||
(generateJSSpec JQueryCustom $ JQ.generateJQueryJSWith customOptions)
|
generateJSSpec JQueryCustom (JQ.generateJQueryJSWith customOptions)
|
||||||
(generateJSSpec Angular $ NG.generateAngularJS NG.defAngularOptions)
|
generateJSSpec Angular (NG.generateAngularJS NG.defAngularOptions)
|
||||||
(generateJSSpec AngularCustom $ (NG.generateAngularJSWith NG.defAngularOptions) customOptions)
|
generateJSSpec AngularCustom (NG.generateAngularJSWith NG.defAngularOptions customOptions)
|
||||||
|
|
||||||
(angularSpec Angular)
|
angularSpec Angular
|
||||||
(angularSpec AngularCustom)
|
angularSpec AngularCustom
|
||||||
|
|
||||||
angularSpec :: TestNames -> Spec
|
angularSpec :: TestNames -> Spec
|
||||||
angularSpec test = describe specLabel $ do
|
angularSpec test = describe specLabel $ do
|
||||||
|
@ -143,11 +143,9 @@ generateJSSpec n gen = describe specLabel $ do
|
||||||
parseFromString jsStr `shouldSatisfy` isRight
|
parseFromString jsStr `shouldSatisfy` isRight
|
||||||
where
|
where
|
||||||
specLabel = "generateJS(" ++ (show n) ++ ")"
|
specLabel = "generateJS(" ++ (show n) ++ ")"
|
||||||
--output = print
|
|
||||||
output _ = return ()
|
output _ = return ()
|
||||||
genJS req = gen req
|
genJS req = gen req
|
||||||
header :: TestNames -> String -> String -> String
|
header :: TestNames -> String -> String -> String
|
||||||
header v headerName headerValue
|
header v headerName headerValue
|
||||||
| v `elem` [Vanilla, VanillaCustom] = "xhr.setRequestHeader(\"" ++ headerName ++ "\", " ++ headerValue ++ ");\n"
|
| v `elem` [Vanilla, VanillaCustom] = "xhr.setRequestHeader(\"" ++ headerName ++ "\", " ++ headerValue ++ ");\n"
|
||||||
| otherwise = "headers: { \"" ++ headerName ++ "\": " ++ headerValue ++ " }\n"
|
| otherwise = "headers: { \"" ++ headerName ++ "\": " ++ headerValue ++ " }\n"
|
||||||
--header _ _ _ = "Not Implemented"
|
|
||||||
|
|
Loading…
Reference in a new issue