Fix tests in 7 and 8
This commit is contained in:
@@ -45,5 +45,5 @@ all =
|
||||
in
|
||||
assertEqual
|
||||
True
|
||||
(isError (decodeString responseDecoder response))
|
||||
(isErrorResult (decodeString responseDecoder response))
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Part 7
|
||||
Part 8
|
||||
======
|
||||
|
||||
## Installation
|
||||
@@ -16,3 +16,10 @@ to fail; in that case, just run `elm package install` again.)
|
||||
elm live Main.elm --open -- --output=elm.js
|
||||
```
|
||||
|
||||
## Running Tests
|
||||
|
||||
```bash
|
||||
cd test
|
||||
elm package install
|
||||
elm test TestRunner.elm
|
||||
```
|
||||
|
||||
@@ -32,4 +32,20 @@ all =
|
||||
, { id = 3, name = "bar", stars = 77 }
|
||||
]
|
||||
)
|
||||
, test "they result in an error for invalid JSON"
|
||||
<| let
|
||||
response =
|
||||
"""{ "pizza": [] }"""
|
||||
|
||||
isErrorResult result =
|
||||
case result of
|
||||
Ok _ ->
|
||||
False
|
||||
|
||||
Err _ ->
|
||||
True
|
||||
in
|
||||
assertEqual
|
||||
True
|
||||
(isErrorResult (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