diff --git a/bin/fake-elm b/bin/fake-elm index f41898f..6bd5a44 100755 --- a/bin/fake-elm +++ b/bin/fake-elm @@ -3,7 +3,7 @@ var yargs = require("yargs"); var spawn = require("child_process").spawn; var fs = require("fs-extra"); -var which = require("which"); +var which = require("npm-which")(process.cwd()); var elmBinary = which.sync("elm"); diff --git a/lib/runner.js b/lib/runner.js index fab55e2..36eddda 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -106,17 +106,21 @@ var setupTests = (log, args) => () => { var runTests = (log, args) => () => { log.info("testRunInit", "Running tests..."); return new Promise(function(resolve, reject) { + var elmTest = args["elm-test"]; + if (elmTest !== "elm-test") { + elmTest = path.resolve(elmTest); + } log.debug( "testRun", "spawning " + - args["elm-test"] + + elmTest + " --compiler " + fakeElmBinary + " " + args.tests ); var process = spawn( - args["elm-test"], + elmTest, ["--compiler", fakeElmBinary, args.tests] .concat(args._) .concat(args.report === "json" ? ["--report", "json"] : []), diff --git a/package-lock.json b/package-lock.json index 0b9673c..4712420 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "fs-extra": "^4.0.3", "lodash": "^4.17.15", "moment": "^2.24.0", + "npm-which": "^3.0.1", "opn": "^5.5.0", "request": "^2.88.0", "table": "^6.8.0", @@ -1472,6 +1473,41 @@ "node": ">=0.10.0" } }, + "node_modules/npm-path": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.4.tgz", + "integrity": "sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw==", + "dependencies": { + "which": "^1.2.10" + }, + "bin": { + "npm-path": "bin/npm-path" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/npm-which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-which/-/npm-which-3.0.1.tgz", + "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=", + "dependencies": { + "commander": "^2.9.0", + "npm-path": "^2.0.2", + "which": "^1.2.10" + }, + "bin": { + "npm-which": "bin/npm-which.js" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/npm-which/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -3420,6 +3456,31 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, + "npm-path": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.4.tgz", + "integrity": "sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw==", + "requires": { + "which": "^1.2.10" + } + }, + "npm-which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-which/-/npm-which-3.0.1.tgz", + "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=", + "requires": { + "commander": "^2.9.0", + "npm-path": "^2.0.2", + "which": "^1.2.10" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + } + } + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", diff --git a/package.json b/package.json index 43e046f..6622842 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "fs-extra": "^4.0.3", "lodash": "^4.17.15", "moment": "^2.24.0", + "npm-which": "^3.0.1", "opn": "^5.5.0", "request": "^2.88.0", "table": "^6.8.0",