You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/12/23 17:43:41 UTC

cordova-cli git commit: CB-8129 Adds 'npm run cover' command to generate tests coverage report

Repository: cordova-cli
Updated Branches:
  refs/heads/master 17ce90623 -> 3afab318b


CB-8129 Adds 'npm run cover' command to generate tests coverage report


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/3afab318
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/3afab318
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/3afab318

Branch: refs/heads/master
Commit: 3afab318bfcf976b3add8db24cd1fb0fac7cb4d5
Parents: 17ce906
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Mon Dec 15 10:54:05 2014 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Mon Dec 15 10:54:05 2014 +0300

----------------------------------------------------------------------
 .gitignore       | 1 +
 README.md        | 4 ++++
 package.json     | 4 +++-
 spec/cli.spec.js | 3 ---
 4 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/3afab318/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 3e180c5..f2b11bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+coverage
 node_modules
 npm-debug.log
 temp

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/3afab318/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index dffac20..14c5202 100644
--- a/README.md
+++ b/README.md
@@ -239,6 +239,10 @@ The directory structure of KewlApp now looks like this:
 
     npm test
 
+## Get test coverage reports
+
+    npm run cover
+
 ## TO-DO + Issues
 
 Please check [Cordova issues with the CLI Component](http://issues.cordova.io). If you find issues with this tool, please be so kind as to include relevant information needed to debug issues such as:

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/3afab318/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index aadbf4a..61c0e17 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,8 @@
     "cordova": "./bin/cordova"
   },
   "scripts": {
-    "test": "jasmine-node --captureExceptions --color spec"
+    "test": "node node_modules/jasmine-node/bin/jasmine-node --captureExceptions --color spec",
+    "cover": "node node_modules/istanbul/lib/cli.js cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec"
   },
   "repository": {
     "type": "git",
@@ -34,6 +35,7 @@
     "underscore":"1.7.0"
   },
   "devDependencies": {
+    "istanbul": "^0.3.4",
     "jasmine-node": "1.14.5"
   },
   "author": "Anis Kadri",

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/3afab318/spec/cli.spec.js
----------------------------------------------------------------------
diff --git a/spec/cli.spec.js b/spec/cli.spec.js
index c619617..81f6b6d 100644
--- a/spec/cli.spec.js
+++ b/spec/cli.spec.js
@@ -30,9 +30,6 @@ describe("cordova cli", function () {
         // logging events registered as a result of the "--verbose" flag in
         // CLI testing below would cause lots of logging messages printed out by other specs.
         spyOn(events, "on");
-        // Each call to cli() registers another listener for uncaughtException.
-        // This results in a warning when too many of them are registered.
-        process.removeAllListeners();
         spyOn(console, 'log');
     });
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org