Add a third failing test to elm-test section.
This commit is contained in:
@@ -15,8 +15,8 @@ all =
|
||||
"""{ "items": [] }"""
|
||||
in
|
||||
assertEqual
|
||||
(decodeString responseDecoder emptyResponse)
|
||||
({- TODO: what goes here? -})
|
||||
(decodeString responseDecoder emptyResponse)
|
||||
, test "they can decode responses with results in them"
|
||||
<| let
|
||||
response =
|
||||
@@ -25,10 +25,25 @@ all =
|
||||
] }"""
|
||||
in
|
||||
assertEqual
|
||||
(decodeString responseDecoder response)
|
||||
(Ok
|
||||
[ { id = 5, name = "foo", stars = 42 }
|
||||
, { id = 3, name = "bar", stars = 77 }
|
||||
]
|
||||
)
|
||||
(decodeString responseDecoder response)
|
||||
, test "they result in an error for invalid JSON"
|
||||
<| let
|
||||
response =
|
||||
"""{ "pizza": [] }"""
|
||||
|
||||
isErrorResult result =
|
||||
-- TODO return True if the given Result is an Err of some sort,
|
||||
-- and False if it is an Ok of some sort.
|
||||
--
|
||||
-- Result docs: http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Result
|
||||
False
|
||||
in
|
||||
assertEqual
|
||||
True
|
||||
(isError (decodeString responseDecoder response))
|
||||
]
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"exposed-modules": [],
|
||||
"dependencies": {
|
||||
"deadfoxygrandpa/elm-test": "3.1.1 <= v < 4.0.0",
|
||||
"NoRedInk/elm-decode-pipeline": "1.0.0 <= v < 2.0.0",
|
||||
"elm-lang/core": "3.0.0 <= v < 4.0.0",
|
||||
"evancz/elm-effects": "2.0.0 <= v < 3.0.0",
|
||||
"evancz/elm-html": "4.0.0 <= v < 5.0.0",
|
||||
|
||||
Reference in New Issue
Block a user