Can't find Mocha modules when running tests but can when discovering tests

Nov 19, 2014 at 11:11 AM
I've imported a node project from Web Storm to use in VS. Everything is working except Mocha test execution. I've gone through various diagnostic/debugging steps and I've narrowed the issue down a bit, I just don't know how to resolve it.

I've modified the mocha.js file to output additional information when it fails to load the module and what I see in the output is that it's looking in: C:\projects\projectname"\node_modules\mocha. I can only think that it's this extra double quote that's causing the module to not be found. This quote is present in the run_tests.js file when it calls mocha which I have determined by outputting the contents of argv.

Now I can see that the same discover mocha method is called in both the discover tests and run tests cases. The test discovery works fine so I believe that this step must be passing the project directory through correctly but I can't understand why the project directory is different between the 2 cases. It may be that I've got something configured incorrectly but I can't find where.

I'm using VS 2013 pro update 4 with Node tools 1.0.21029.05.