nathanboktae / mocha-casperjs

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

Clean way of requiring modules #93

Open windkomo opened 8 years ago

windkomo commented 8 years ago

Hello,

Is there a clean way of requiring a node module ?

Currently, I'm using casperjs's utils like this :

var utils = require('../../../node_modules/casperjs/modules/utils');

Before using mocha-casperjs, I was using :

var utils = require('utils');

Any best practice here ?

nathanboktae commented 8 years ago

That should work. mocha-casperjs doesn't mess with casper's patched require. Perhaps something regressed in casper's patched require between casper versions?

windkomo commented 8 years ago

I have no idea, I was requiring utils just fine, and then reworked tests a bit to use mocha-casperjs, and it stopped working (tests are not run) until I specified the complete path to node_modules.