Rearrange stuff into src/ and test/

This commit is contained in:
Richard Feldman
2016-03-04 03:47:40 -08:00
parent a807a19d9b
commit 145aa8414f
5 changed files with 36 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
"repository": "https://github.com/evancz/start-app.git",
"license": "BSD-3-Clause",
"source-directories": [
"."
"src"
],
"exposed-modules": [],
"dependencies": {

View File

@@ -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"
}
}

View 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
View 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)
]