Closed davidosomething closed 10 years ago
This is due to #41 just by looking at the result of npm install
. Let me publish a version with the fix.
ah no it's not. I see what's happening. You have chai
and casper-chai
as dev dependencies, so npm doesn't install them adjacent to mocha-casperjs
under grunt-mocha-casperjs
. mocha-casperjs does not run under npm, which means simple require('chai')
where chai is in some path that node knows about, like a parent node_modules directory, but phantomjs doesn't, does not work. it litterally needs to be adjacent to mocha-casperjs, otherwise you have to do what you did, or specify --chai-path
and --capser-chai-path
.
I removed chai
and casper-chai
from your node modules and it worked as you desired.
Here's the branch where it fails: https://github.com/davidosomething/glutton/tree/casper-chai-detect
Here's the grunt command:
The grunt config is https://github.com/davidosomething/glutton/blob/master/config/grunt/mocha-casperjs.coffee
I have to manually require chai, casper-chai:
adding this to the top for my tests (in test/e2e/index.coffee) to work Tests: https://github.com/davidosomething/glutton/blob/casper-chai-detect/test/e2e/index.coffee
But mocha-casperjs says it should automatically detect them. Adding @roman01la in case it is grunt-mocha-casperjs issue