jdcataldo / grunt-mocha-phantomjs

A simple grunt wrapper for mocha-phantomjs to allow for ci integration
MIT License
70 stars 40 forks source link

mocha-phantomjs dependencies #4

Closed DmitryBochkarev closed 11 years ago

DmitryBochkarev commented 11 years ago

Now i have another trouble... Module mocha-phnatomjs does not have phantomjs in dependencies... But when spawn phantom process path for binary resolved this way:

var phantomjs;
for (var i=0; i < module.paths.length; i++) {
  var bin = path.join(module.paths[i], '.bin/phantomjs');
  if (process.platform === 'win32') {
    bin += '.cmd';
  }
  if (exists(bin)) {
    phantomjs = spawn(bin, spawnArgs);
    break;
  }
}
if (phantomjs === undefined) { phantomjs = spawn('phantomjs', spawnArgs); }

Because grunt-mocha-phantomjs have phantom in package.json dependencies phantomjs spawn by last line... To resolve this issue i suggest remove phantomjs from dependencies and add notation on readme about need to include phantomjs in the list of dependencies in the project.

And one another thing: in cf1d867 commit resolving path should bubble from down to top level as in code above. Should i send pull request?

jdcataldo commented 11 years ago

If you are going to install mocha-phantomjs separately then you will need to install phantomjs as well. It is a dependency that you need for mocha-phantomjs. Once you do that everything will work as expected since grunt-mocha-phantomjs will find mocha-phantomjs and mocha-phantomjs will find phantomjs. I set the dependencies to make the installation from npm super easy and have everythign self contained.

DmitryBochkarev commented 11 years ago

i undestand. thaks.