diff --git a/install.js b/install.js index cf60ab0..1b995dd 100644 --- a/install.js +++ b/install.js @@ -7,4 +7,10 @@ fs.readdirSync("stages").forEach(function(stage) { console.log("Installing packages for " + cwd); execSync("elm-package install --yes", { cwd: cwd }); + + var testCwd = path.join(cwd, "test"); + + if (fs.existsSync(testCwd)) { + execSync("elm-package install --yes", { cwd: testCwd }); + } }); diff --git a/stages/5/elm-package.json b/stages/5/elm-package.json index c5b0298..dfaf05d 100644 --- a/stages/5/elm-package.json +++ b/stages/5/elm-package.json @@ -4,18 +4,15 @@ "repository": "https://github.com/rtfeldman/elm-workshop.git", "license": "BSD-3-Clause", "source-directories": [ - "src", - "test" + "src" ], "exposed-modules": [], "dependencies": { - "deadfoxygrandpa/elm-test": "3.1.1 <= v < 4.0.0", "elm-lang/core": "3.0.0 <= v < 4.0.0", "evancz/elm-effects": "2.0.0 <= v < 3.0.0", "evancz/elm-html": "4.0.0 <= v < 5.0.0", "evancz/elm-http": "3.0.0 <= v < 4.0.0", - "evancz/start-app": "2.0.0 <= v < 3.0.0", - "laszlopandy/elm-console": "1.0.3 <= v < 2.0.0" + "evancz/start-app": "2.0.0 <= v < 3.0.0" }, "elm-version": "0.16.0 <= v < 0.17.0" } diff --git a/stages/5/package.json b/stages/5/package.json index 8a75cf1..99620c2 100644 --- a/stages/5/package.json +++ b/stages/5/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "elm-make src/Main.elm --output elm.js", "watch": "../../node_modules/.bin/elm-live src/Main.elm --open -- --output=elm.js", - "test": "../../node_modules/.bin/elm-test test/TestRunner.elm", + "test": "node test.js", "install": "npm run build" }, "repository": { diff --git a/stages/5/test.js b/stages/5/test.js new file mode 100644 index 0000000..2edefdd --- /dev/null +++ b/stages/5/test.js @@ -0,0 +1,10 @@ +var fs = require("fs"); +var execSync = require("child_process").execSync; +var path = require("path"); +var testDir = path.join(__dirname, "test"); +var binPath = path.join(__dirname, "..", "..", "node_modules", ".bin"); +var elmTestPath = path.join(binPath, "elm-test"); +var elmMakePath = path.join(binPath, "elm-make"); + +execSync(elmMakePath + " TestRunner.elm --yes --output /dev/null", { cwd: testDir }); +execSync(elmTestPath + " TestRunner.elm", { cwd: testDir, stdio: "inherit" }); diff --git a/stages/5/test/elm-package.json b/stages/5/test/elm-package.json new file mode 100644 index 0000000..abbb0c1 --- /dev/null +++ b/stages/5/test/elm-package.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0", + "summary": "Like GitHub, but for Elm stuff.", + "repository": "https://github.com/rtfeldman/elm-workshop.git", + "license": "BSD-3-Clause", + "source-directories": [ + ".", + "../src" + ], + "exposed-modules": [], + "dependencies": { + "deadfoxygrandpa/elm-test": "3.1.1 <= v < 4.0.0", + "elm-lang/core": "3.0.0 <= v < 4.0.0", + "evancz/elm-effects": "2.0.0 <= v < 3.0.0", + "evancz/elm-html": "4.0.0 <= v < 5.0.0", + "evancz/elm-http": "3.0.0 <= v < 4.0.0", + "evancz/start-app": "2.0.0 <= v < 3.0.0", + "laszlopandy/elm-console": "1.0.3 <= v < 2.0.0" + }, + "elm-version": "0.16.0 <= v < 0.17.0" +}