From 8be7b06173ae602273020f82a580ea5e76c2a4a6 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 22 Nov 2015 11:31:05 -0800 Subject: [PATCH 1/5] Remove a console.log --- bin/elm-test | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/elm-test b/bin/elm-test index 6dfd0227..687c6bf1 100755 --- a/bin/elm-test +++ b/bin/elm-test @@ -73,7 +73,6 @@ temp.open({ prefix:'elm_test_', suffix:'.js' }, function(err, info) { var dest = info.path; var compileProcess = compile([testFile], {output: dest, spawn: spawnCompiler}); - console.log("Compiling", testFile); compileProcess.stdout.setEncoding("utf8") compileProcess.stdout.on("data", function(data) { From c718c9ed69b2ab40bfa0dd8a9c75e21415c8ffb9 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 22 Nov 2015 11:31:53 -0800 Subject: [PATCH 2/5] Upgrade temp and fs-extra --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c21db60d..ee26be56 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ }, "homepage": "https://github.com/rtfeldman/node-elm-test#readme", "dependencies": { - "fs-extra": "0.23.1", + "fs-extra": "0.26.2", "lodash": "3.10.1", "node-elm-compiler": "1.0.1", - "temp": "0.8.1" + "temp": "0.8.3" } } From ece680b6dc37dd790bfa454adee46685090f8cbe Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 22 Nov 2015 11:56:14 -0800 Subject: [PATCH 3/5] Add a --compiler flag --- bin/elm-test | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/elm-test b/bin/elm-test index 687c6bf1..3322be80 100755 --- a/bin/elm-test +++ b/bin/elm-test @@ -49,8 +49,9 @@ if (process.argv[2] == "init") { process.exit(0); } -var testFile = process.argv[2], - cwd = __dirname; +var testFile = process.argv[2], + cwd = __dirname, + pathToMake = undefined; function spawnCompiler(cmd, args, opts) { var compilerOpts = _.defaults({stdio: ["inherit", "pipe", "inherit"]}, opts); @@ -60,7 +61,7 @@ function spawnCompiler(cmd, args, opts) { if (typeof testFile !== "string") { console.log("Usage: elm-test init [--yes] # Create example tests\n"); - console.log("Usage: elm-test TESTFILE # Run tests\n"); + console.log("Usage: elm-test TESTFILE [--compiler /path/to/compiler] # Run tests\n"); process.exit(1); } From e1b054cb5b88552aad32d040858e96da3e37d75d Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 22 Nov 2015 11:56:27 -0800 Subject: [PATCH 4/5] Strip out more unnecessary compiler output. --- bin/elm-test | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/elm-test b/bin/elm-test index 3322be80..26746261 100755 --- a/bin/elm-test +++ b/bin/elm-test @@ -70,17 +70,27 @@ if (!fs.existsSync(testFile)) { process.exit(1); } +if (process.argv[3] == "--compiler" || process.argv[3] == "-c") { + pathToMake = process.argv[4]; + + if (!pathToMake) { + console.error("The --compiler option must be given a path to an elm-make executable."); + process.exit(1); + } +} + temp.open({ prefix:'elm_test_', suffix:'.js' }, function(err, info) { var dest = info.path; - var compileProcess = compile([testFile], {output: dest, spawn: spawnCompiler}); - + var compileProcess = compile( [testFile], + {output: dest, spawn: spawnCompiler, pathToMake: pathToMake}); compileProcess.stdout.setEncoding("utf8") compileProcess.stdout.on("data", function(data) { // Explicitly strip out the "Successfully generated" message. // This avoids the nasty compiler output message for the temp file, e.g. // "Successfully generated /var/folders/f2/afd9fg0acfg32/elm_test_3423940" - if ((typeof data === "string") && !data.match(/^Successfully generated /)) { + // Also strip out "Success! Compiled 1 module." + if ((typeof data === "string") && !/^Success/.test(data)) { console.log(data); } }); From a5dc16bc2e8b4b32e2d49c7a3074b4086ac497f2 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 22 Nov 2015 11:56:36 -0800 Subject: [PATCH 5/5] Upgrade to node-elm-compiler 2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee26be56..a602f5d0 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "fs-extra": "0.26.2", "lodash": "3.10.1", - "node-elm-compiler": "1.0.1", + "node-elm-compiler": "2.0.0", "temp": "0.8.3" } }