Commit 6df047da 6df047daa2520b831dbef424fe034d5cb47ecf4a by Nicolas Perriault

fixed selftest single test path resolution

1 parent 45affec1
...@@ -216,7 +216,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); ...@@ -216,7 +216,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
216 phantom.casperScript = fs.absolute(fs.pathJoin(baseTestsPath, 'run.js')); 216 phantom.casperScript = fs.absolute(fs.pathJoin(baseTestsPath, 'run.js'));
217 phantom.casperTest = true; 217 phantom.casperTest = true;
218 phantom.casperArgs.drop("test"); 218 phantom.casperArgs.drop("test");
219 phantom.casperScriptBaseDir = fs.dirname(phantom.casperArgs.get(0)); 219 phantom.casperScriptBaseDir = fs.dirname(phantom.casperArgs.get(1));
220 } else if (phantom.casperArgs.get(0) === "selftest") { 220 } else if (phantom.casperArgs.get(0) === "selftest") {
221 phantom.casperScript = fs.absolute(fs.pathJoin(baseTestsPath, 'run.js')); 221 phantom.casperScript = fs.absolute(fs.pathJoin(baseTestsPath, 'run.js'));
222 phantom.casperSelfTest = phantom.casperTest = true; 222 phantom.casperSelfTest = phantom.casperTest = true;
...@@ -225,7 +225,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); ...@@ -225,7 +225,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
225 phantom.casperArgs.args.push(fs.pathJoin(baseTestsPath, 'suites')); 225 phantom.casperArgs.args.push(fs.pathJoin(baseTestsPath, 'suites'));
226 } 226 }
227 phantom.casperArgs.drop("selftest"); 227 phantom.casperArgs.drop("selftest");
228 phantom.casperScriptBaseDir = fs.dirname(phantom.casperArgs.get(0) || fs.dirname(phantom.casperScript)); 228 phantom.casperScriptBaseDir = fs.dirname(phantom.casperArgs.get(1) || fs.dirname(phantom.casperScript));
229 } else if (phantom.casperArgs.args.length === 0 || !!phantom.casperArgs.options.help) { 229 } else if (phantom.casperArgs.args.length === 0 || !!phantom.casperArgs.options.help) {
230 return printHelp(); 230 return printHelp();
231 } 231 }
......