From 41b5e576ca276e64382d2484f43e4e8ae9c35557 Mon Sep 17 00:00:00 2001 From: Adrian Zankich Date: Wed, 21 May 2014 19:35:09 -0700 Subject: [PATCH] Add CodeClimate coverage --- .gitignore | 1 + .travis.yml | 5 ++++- Makefile | 6 +++++- package.json | 27 ++++++++++----------------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 91fa8cf..a1dca14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules/ npm-debug.log +/coverage/ diff --git a/.travis.yml b/.travis.yml index 22ef7ed..fb3cc1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: node_js -script: "make" +script: + - npm install -g codeclimate-test-reporter + - make cover + - CODECLIMATE_REPO_TOKEN=d3aad610220b6eaf4f51e38393c1b62586b1d68b898b42e418d9c2a8e0a7cb0d codeclimate < coverage/lcov.info node_js: - '0.10' branches: diff --git a/Makefile b/Makefile index a4991a8..d3ce8ed 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,11 @@ TEST_FILES := test/support.js $(shell find test/specs -type f -name "*.js") VERSION := $(shell node -e "console.log(require('./package.json').version)") # Our 'phony' make targets (don't involve any file changes) -.PHONY: test bdd lint release +.PHONY: cover test bdd lint release + +# Run Mocha, with coverage. +cover: + @$(BIN)/istanbul cover $(BIN)/_mocha $(TEST_FILES) --report lcovonly -- -R spec # Run Mocha, with standard reporter. test: diff --git a/package.json b/package.json index 5d44e24..c7f81c3 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,7 @@ "description": "A JavaScript robotics framework using Node.js", "homepage": "http://cylonjs.com", "bugs": "https://github.com/hybridgroup/cylon/issues", - "author": "The Hybrid Group ", - "contributors": [ "Ron Evans ", "Andrew Stewart ", @@ -16,14 +14,11 @@ "Gize Bonilla ", "Adrian Zankich " ], - "repository": { "type": "git", "url": "https://github.com/hybridgroup/cylon" }, - "license": "Apache 2.0", - "hardware": { "*": false, "./": false, @@ -31,23 +26,21 @@ "node-namespace": true, "./lib": true }, - - "engines" : { - "node" : ">= 0.10.20" + "engines": { + "node": ">= 0.10.20" }, - "devDependencies": { "sinon-chai": "2.5.0", - "chai": "1.9.1", - "mocha": "1.18.2", - "sinon": "1.9.1", - "jshint": "2.5.0" + "chai": "1.9.1", + "mocha": "1.18.2", + "sinon": "1.9.1", + "jshint": "2.5.0", + "istanbul": "0.2.10" }, - "dependencies": { - "async": "0.7.0", + "async": "0.7.0", + "express": "3.5.1", "node-namespace": "1.0.0", - "express": "3.5.1", - "robeaux": ">= 0.1.0" + "robeaux": ">= 0.1.0" } }