Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
169 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,45 @@ | ||
NBIN=./node_modules/.bin | ||
NBIN=$(shell pwd)/node_modules/.bin | ||
ELM_TEST=$(NBIN)/elm-test --compiler $(NBIN)/elm-make | ||
|
||
|
||
help: ## Prints help for targets with comments | ||
.PHONY: help | ||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
|
||
.PHONY: install | ||
install: ## Install deps | ||
mix deps.get | ||
yarn install | ||
$(NBIN)/elm-package install | ||
|
||
|
||
.PHONY: start | ||
start: ## Start the server in dev mode | ||
iex -S mix | ||
|
||
|
||
.PHONY: start-production | ||
start-production: | ||
MIX_ENV=production mix app.start | ||
|
||
|
||
.PHONY: frontend-server | ||
frontend-server: | ||
NODE_ENV=development $(NBIN)/webpack-dev-server --hot --inline --content-base src/, --no-info --colors | ||
|
||
|
||
.PHONY: build | ||
build: ## Compile the frontend | ||
rm -rf dist | ||
NODE_ENV=production $(NBIN)/webpack -p | ||
|
||
|
||
.PHONY: \ | ||
start-production \ | ||
frontend-server \ | ||
install \ | ||
start \ | ||
build \ | ||
help | ||
.PHONY: elm-test | ||
elm-test: ## Run the front end tests | ||
$(ELM_TEST) | ||
|
||
|
||
.PHONY: elm-test-watch | ||
elm-test-watch: ## Run the front end test watcher | ||
$(ELM_TEST) --watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/elm-stuff/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
port module Main exposing (..) | ||
|
||
import Tests | ||
import Test.Runner.Node exposing (run, TestProgram) | ||
import Json.Encode exposing (Value) | ||
|
||
|
||
main : TestProgram | ||
main = | ||
run emit Tests.all | ||
|
||
|
||
port emit : ( String, Value ) -> Cmd msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Tests exposing (..) | ||
|
||
import Test exposing (..) | ||
import Expect | ||
import Fuzz exposing (list, int, tuple, string) | ||
import String | ||
|
||
|
||
all : Test | ||
all = | ||
describe "Sample Test Suite" | ||
[ describe "Unit test examples" | ||
[ test "Addition" <| | ||
\() -> Expect.equal (3 + 7) 10 | ||
, test "String.left" <| | ||
\() -> | ||
Expect.equal "a" (String.left 1 "abcdefg") | ||
] | ||
, describe "Fuzz test examples, using randomly generated input" | ||
[ fuzz (list int) "Lists always have positive length" <| | ||
\aList -> | ||
List.length aList | ||
|> Expect.atLeast 0 | ||
, fuzz (list int) "Sorting a list does not change its length" <| | ||
\aList -> | ||
List.sort aList | ||
|> List.length | ||
|> Expect.equal (List.length aList) | ||
, fuzzWith { runs = 1000 } int "List.member will find an integer in a list containing it" <| | ||
\i -> | ||
List.member i [ i ] | ||
|> Expect.true "If you see this, List.member returned False!" | ||
, fuzz2 string string "The length of a string equals the sum of its substrings' lengths" <| | ||
\s1 s2 -> | ||
s1 | ||
++ s2 | ||
|> String.length | ||
|> Expect.equal (String.length s1 + String.length s2) | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"version": "1.0.0", | ||
"summary": "", | ||
"repository": "https://github.com/lpil/elixre.git", | ||
"license": "AGPLv3", | ||
"source-directories": [ | ||
".", | ||
"../client" | ||
], | ||
"exposed-modules": [], | ||
"dependencies": { | ||
"elm-community/json-extra": "2.0.0 <= v < 3.0.0", | ||
"elm-lang/html": "2.0.0 <= v < 3.0.0", | ||
"mgold/elm-random-pcg": "4.0.2 <= v < 5.0.0", | ||
"elm-lang/core": "5.0.0 <= v < 6.0.0", | ||
"elm-community/elm-test": "3.0.0 <= v < 4.0.0", | ||
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0" | ||
}, | ||
"elm-version": "0.18.0 <= v < 0.19.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters