Ari Porad
Ari Porad

Reputation: 2922

Nodeunit - JSCovrage


Is there a way to use JSCoverage to have code coverage for nodeunit?

I know there is nodeunit2, but my code is not in lib, and I do not want to restructure my project.

Upvotes: 3

Views: 352

Answers (1)

Jason
Jason

Reputation: 13766

Sure... Just follow the steps in this example.

The key elements being:

  1. run the jscoverage command on the directory (or directories) that house your code
  2. Provide some mechanism (such as an environment variable) to make a choice when you include your module to include the correct version of your code
  3. When you want code coverage statistics, set your environment variable accordingly

Upvotes: 1

Related Questions