nathanboktae / mocha-casperjs

Write CasperJS tests using Mocha
MIT License
120 stars 30 forks source link

Can't run via script in package.json #84

Closed dschinkel closed 8 years ago

dschinkel commented 8 years ago

This works fine when I run it directly from the terminal:

npm start & mocha-casperjs test/features/specs/*-spec.js

But when I tried throwing it into a script (and I tried many things today to try getting that to work), it blows up:

  "scripts": {
    "test": "node server.js & mocha-casperjs test/features/specs/*-spec.js"
  }

Error when I try to run it via npm test or npm run test:

/Users/dave/code/github-dave/expressjs-casperjs-starterkit/node_modules/.bin/mocha-casperjs: line 36: /Users/dave/code/github-dave/expressjs-casperjs-starterkit/node_modules/mocha-casperjs/bin/../../casperjs/bin/casperjs: No such file or directory
npm ERR! Test failed.  See above for more details.

so it's bombing at /Users/dave/code/github-dave/expressjs-casperjs-starterkit/node_modules/.bin/mocha-casperjs, line: $mcPath/../../casperjs/bin/casperjs $mcPath/cli.js --mocha-casperjs-path=$mcPath/.. $*

dschinkel commented 8 years ago

resolved, was missing the casperjs peer dependency since in npm 3.0+ it doesn't install peer dependencies anymore. Installed casperjs package and now it's fine. Thanks nathan for the catch.