Skip to content
This repository was archived by the owner on Dec 21, 2018. It is now read-only.

Commit 7a511fb

Browse files
Merge pull request #23 from TechforgoodCAST/fix-map-workshop
Update tests in elm-workshop to work with elm-test 0.18
2 parents 45b0126 + e70a50f commit 7a511fb

File tree

2 files changed

+13
-37
lines changed

2 files changed

+13
-37
lines changed

part2/map-workshop/tests/Main.elm

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
port module Main exposing (..)
1+
module Main exposing (..)
22

33
import Expect
44
import Fuzz exposing (..)
5-
import Json.Encode exposing (Value)
65
import MapExercises exposing (..)
76
import Test exposing (..)
8-
import Test.Runner.Node exposing (TestProgram, run)
9-
10-
11-
allTests : Test
12-
allTests =
13-
describe "All Tests"
14-
[ listTests
15-
, maybeTests
16-
, resultTests
17-
]
187

198

209
listTests : Test
@@ -73,7 +62,7 @@ maybeTests =
7362
Expect.equal
7463
(headOfTheList xs)
7564
(List.head xs)
76-
, fuzz (list (maybe int)) "gets the head of the list" <|
65+
, fuzz (list (maybe int)) "gets the head of the list pt. II" <|
7766
\xs ->
7867
Expect.equal
7968
(headOfTheList xs)
@@ -117,7 +106,7 @@ maybeTests =
117106
Expect.equal
118107
(addMaybes Nothing (Just 800))
119108
Nothing
120-
, test "If either is Nothing return Nothing" <|
109+
, test "If either is Nothing return Nothing pt. II" <|
121110
\() ->
122111
Expect.equal
123112
(addMaybes (Just 800) Nothing)
@@ -128,7 +117,8 @@ maybeTests =
128117

129118
resultTests : Test
130119
resultTests =
131-
describe "result tests"
120+
describe
121+
"result tests"
132122
[ describe "getMyAge tests"
133123
[ test "parses an age string correctly" <|
134124
\() ->
@@ -164,7 +154,7 @@ resultTests =
164154
Expect.equal
165155
(combinedAge "28" "blergh")
166156
(Err "could not convert string 'blergh' to an Int")
167-
, test "returns an Err if either of them are invalid" <|
157+
, test "returns an Err if either of them are invalid pt. II" <|
168158
\() ->
169159
Expect.equal
170160
(combinedAge "blergh" "28")
@@ -180,15 +170,3 @@ resultTests =
180170
tupleFuzzer : Fuzzer (List ( Int, String ))
181171
tupleFuzzer =
182172
list <| tuple ( int, string )
183-
184-
185-
186-
-- The two functions below allow the results of the tests to be printed to the terminal
187-
188-
189-
main : TestProgram
190-
main =
191-
run emit allTests
192-
193-
194-
port emit : ( String, Value ) -> Cmd msg
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
22
"version": "1.0.0",
3-
"summary": "Tests for map workshop exercises",
3+
"summary": "Test Suites",
44
"repository": "https://github.com/TechforgoodCAST/elm-week.git",
55
"license": "MIT",
66
"source-directories": [
7-
".",
8-
"../"
7+
"..",
8+
"."
99
],
1010
"exposed-modules": [],
1111
"dependencies": {
12-
"elm-community/json-extra": "2.0.0 <= v < 3.0.0",
13-
"elm-lang/html": "2.0.0 <= v < 3.0.0",
14-
"mgold/elm-random-pcg": "4.0.2 <= v < 5.0.0",
15-
"elm-lang/core": "5.0.0 <= v < 6.0.0",
16-
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
17-
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
12+
"eeue56/elm-html-test": "5.1.1 <= v < 6.0.0",
13+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0",
14+
"elm-lang/core": "5.1.1 <= v < 6.0.0",
15+
"elm-lang/html": "2.0.0 <= v < 3.0.0"
1816
},
1917
"elm-version": "0.18.0 <= v < 0.19.0"
2018
}

0 commit comments

Comments
 (0)