Permalink
Browse files

Use istanbul to check for code coverage.

By using istanbul (https://github.com/yahoo/istanbul), we can check for branch
coverage and not only statement coverage.

http://code.google.com/p/esprima/issues/detail?id=385
  • Loading branch information...
ariya committed Nov 29, 2012
1 parent c9fa4e7 commit 56e624535570a8d3b507383c48289333f505ee64
Showing with 7 additions and 14 deletions.
  1. +4 −12 doc/index.html
  2. +3 −2 package.json
View
@@ -349,23 +349,15 @@ <h4 id="coverage">Code coverage test</h4>
<p>Note: you need to use Node.js 0.6 or later version.</p>
-<p>Install node-cover:</p>
+<p>Install istanbul:</p>
-<pre class="prettyprint lang-bsh">sudo npm install -g cover</pre>
+<pre class="prettyprint lang-bsh">sudo npm install -g istanbul</pre>
<p>Run it in Esprima source tree:</p>
-<pre class="prettyprint lang-bsh">cover run test/runner.js</pre>
+<pre class="prettyprint lang-bsh">istanbul cover test/runner.js</pre>
-<p>Check the quick report:</p>
-
-<pre class="prettyprint lang-bsh">cover report</pre>
-
-<p>To get the detailed report:</p>
-
-<pre class="prettyprint lang-bsh">cover report html</pre>
-
-<p>and then open <code>cover_html/index.html</code> file and choose <code>esprima.js</code> from the list.</p>
+<p>To get the detailed report, open <code>coverage/lcov-report/index.html</code> file and choose <code>esprima.js</code> from the list.</p>
<h4 id="benchmark">Benchmark tests</h4>
View
@@ -25,10 +25,11 @@
"url": "http://github.com/ariya/esprima/raw/master/LICENSE.BSD"
}],
"devDependencies": {
- "jslint": "~0.1.9"
+ "jslint": "~0.1.9",
+ "istanbul": "~0.1.22"
},
"scripts": {
- "test": "node_modules/jslint/bin/jslint.js esprima.js && node test/run.js",
+ "test": "node_modules/jslint/bin/jslint.js esprima.js && node test/run.js && node node_modules/istanbul/lib/cli.js cover test/runner.js",
"benchmark": "node test/benchmarks.js",
"benchmark-quick": "node test/benchmarks.js quick"
}

0 comments on commit 56e6245

Please sign in to comment.