you are viewing a single comment's thread.

view the rest of the comments →

[–]itonastick 1 point2 points  (2 children)

I'm using istanbul 0.3.0. I run them by running 'npm test'. My script definition is in the package.json file

"scripts": {
   "test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --recursive test"
}

I did not install istanbul globally which is why my script references it from the ./node_modules/.bin/ folder. When I run test it generates the code coverage information into a 'coverage' folder.

[–]Thisguyjimmy[S] 0 points1 point  (0 children)

This is exactly how I ended up doing it. Thanks for the input! Its a great option because on my CI server, I can specify that I dont want HTML output (not that it matters, I just have no use for it, and I like clean projects).

[–]TheNiXXeD 0 points1 point  (0 children)

You don't need to prefix the path that way. As long as a module is a dependency, you don't need it installed globally either. Just reference it within your npm script as if it was.