mocha-casperjs
mocha-casperjs copied to clipboard
Clean way of requiring modules
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 ?
That should work. mocha-casperjs
doesn't mess with casper's patched require. Perhaps something regressed in casper's patched require between casper versions?
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.