Skip to content

Instantly share code, notes, and snippets.

@danigb
Created May 17, 2016 21:43
Show Gist options
  • Save danigb/8ac47be5789a2586705e75cd0b8e30a6 to your computer and use it in GitHub Desktop.
Save danigb/8ac47be5789a2586705e75cd0b8e30a6 to your computer and use it in GitHub Desktop.
How to write and run test with elm-lang 0.17

Testing

Create project and install packages:

elm-package install -y elm-lang/core
elm-package install -y elm-community/elm-test

Run tests:

elm-make tests/Tests.elm --output testRunner.js && node testRunner.js
import ElmTest exposing (..)
import String
tests : Test
tests =
suite "A Test Suite"
[
test "Addition" (assertEqual (3 + 7) 10),
test "String.left" (assertEqual "a" (String.left 1 "abcdefg")),
test "This test should pass" (assert True)
]
main =
runSuite tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment