From 54692695ffd78f777c504085baae869814fbf185 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Tue, 3 Nov 2015 19:46:02 -0800 Subject: [PATCH] Added code coverage reporting. --- .gitignore | 1 + .jshintignore | 3 ++- .travis.yml | 3 +++ package.json | 21 +++++++++++++++++---- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c24a7afcc7..d49592be1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/node_modules/** npm-debug.log +coverage/ \ No newline at end of file diff --git a/.jshintignore b/.jshintignore index 19d9ef5d3c..3efe38d3b6 100644 --- a/.jshintignore +++ b/.jshintignore @@ -2,4 +2,5 @@ appengine/kraken/public/components/** appengine/sails/config/** appengine/sails/tasks/** appengine/sails/assets/** -**/node_modules/** \ No newline at end of file +**/node_modules/** +coverage/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 5a5c7b7ba0..dce4356f0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,3 +52,6 @@ before_install: install: #Add app specific setup here #Use '-q' to disable interactive prompts + +after_success: + - npm run coveralls diff --git a/package.json b/package.json index e31ad2e62f..ddf938af21 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,32 @@ "name": "nodejs-docs-samples", "version": "0.0.1", "description": "Samples used in the nodejs documentation on cloud.google.com", - "main": "index.js", "scripts": { "jshint": "jshint --exclude-path=.jshintignore .", "mocha": "mocha --timeout 10000 --recursive", - "test": "npm run jshint && npm run mocha" + "cover": "istanbul cover --hook-run-in-context node_modules/mocha/bin/_mocha -- --timeout 10000 --recursive", + "coveralls": "cat ./coverage/lcov.info | node_modules/.bin/coveralls", + "test": "npm run jshint && npm run cover" }, - "author": "jerjou@google.com", - "license": "Apache 2", + "author": "Google Inc.", + "contributors": [ + { + "name": "Jerjou", + "email": "jerjou@google.com" + }, + { + "name": "Jason Dobry", + "email": "jason.dobry@gmail.com" + } + ], + "license": "Apache Version 2.0", "private": true, "dependencies": { "googleapis": "~2.1.3" }, "devDependencies": { + "coveralls": "^2.11.4", + "istanbul": "^0.4.0", "jshint": "~2.8.0", "lodash": "~3.10.1", "mocha": "^2.2.5",