diff --git a/.gitignore b/.gitignore index 3bd52a1..8b3e96c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,39 @@ + +### Elm ### elm-stuff elm.js + +# Elm test artifacts +elm-io.sh +raw-test.js +test.js + +### Node ### +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c56075f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: haskell +install: + - wget http://deadfoxygrandpa.github.io/elm-travis-cache/elm-test-install.sh + - bash elm-test-install.sh +before_script: + - ./elm-make --yes --output raw-test.js TestRunner.elm + - bash elm-io.sh raw-test.js test.js +script: node test.js \ No newline at end of file diff --git a/TestRunner.elm b/TestRunner.elm new file mode 100644 index 0000000..00af16d --- /dev/null +++ b/TestRunner.elm @@ -0,0 +1,18 @@ +import String + +import IO.IO exposing (..) +import IO.Runner exposing (Request, Response, run) +import ElmTest.Runner.Console exposing (runDisplay) +import ElmTest.Test exposing (..) + +import RogueTest + +tests : Test +tests = suite "Rogue Tests" + [ RogueTest.tests + ] + +port requests : Signal Request +port requests = run responses (runDisplay tests) + +port responses : Signal Response diff --git a/elm-package.json b/elm-package.json index 5151e66..44108a9 100644 --- a/elm-package.json +++ b/elm-package.json @@ -4,11 +4,14 @@ "repository": "https://github.com/chendrix/elm-rogue.git", "license": "MIT", "source-directories": [ - "src" + "src", + "test" ], "exposed-modules": [], "dependencies": { - "elm-lang/core": "2.0.1 <= v < 3.0.0" + "elm-lang/core": "2.0.1 <= v < 3.0.0", + "deadfoxygrandpa/Elm-Test" : "1.0.4 <= v < 2.0.0", + "maxsnew/IO" : "0.1.5 <= v < 2.0.0" }, "elm-version": "0.15.0 <= v < 0.16.0" } \ No newline at end of file diff --git a/test/RogueTest.elm b/test/RogueTest.elm new file mode 100644 index 0000000..d1d111c --- /dev/null +++ b/test/RogueTest.elm @@ -0,0 +1,14 @@ +module RogueTest where + +import ElmTest.Test exposing (..) +import ElmTest.Assertion exposing (..) + +import Rogue +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 fail" (assert False) + ] \ No newline at end of file