Rearrange stuff into src/ and test/
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"repository": "https://github.com/evancz/start-app.git",
|
||||
"license": "BSD-3-Clause",
|
||||
"source-directories": [
|
||||
"."
|
||||
"src"
|
||||
],
|
||||
"exposed-modules": [],
|
||||
"dependencies": {
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
"version": "1.0.0",
|
||||
"description": "Like GitHub, but funkier.",
|
||||
"scripts": {
|
||||
"build": "elm-make FunkHub.elm --output elm.js",
|
||||
"watch": "elm-live FunkHub.elm --open -- --output=elm.js",
|
||||
"build": "elm-make src/FunkHub.elm --output elm.js",
|
||||
"watch": "elm-live src/FunkHub.elm --open -- --output=elm.js",
|
||||
"test": "elm-test TestRunner.elm",
|
||||
"install": "elm-package install --yes && npm run build"
|
||||
},
|
||||
"repository": {
|
||||
@@ -18,6 +19,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/rtfeldman/elm-workshop#readme",
|
||||
"devDependencies": {
|
||||
"elm-live": "2.0.4"
|
||||
"elm-live": "2.0.4",
|
||||
"elm-test": "0.16.0"
|
||||
}
|
||||
}
|
||||
|
||||
15
stages/3/test/TestRunner.elm
Normal file
15
stages/3/test/TestRunner.elm
Normal file
@@ -0,0 +1,15 @@
|
||||
module Main where
|
||||
|
||||
import Signal exposing (Signal)
|
||||
|
||||
import ElmTest exposing (consoleRunner)
|
||||
import Console exposing (IO, run)
|
||||
import Task
|
||||
|
||||
import Tests
|
||||
|
||||
console : IO ()
|
||||
console = consoleRunner Tests.all
|
||||
|
||||
port runner : Signal (Task.Task x ())
|
||||
port runner = run console
|
||||
15
stages/3/test/Tests.elm
Normal file
15
stages/3/test/Tests.elm
Normal file
@@ -0,0 +1,15 @@
|
||||
module Tests where
|
||||
|
||||
import ElmTest exposing (..)
|
||||
|
||||
import String
|
||||
|
||||
|
||||
all : Test
|
||||
all =
|
||||
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)
|
||||
]
|
||||
Reference in New Issue
Block a user