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..060300f 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/README.markdown b/README.markdown index 053d637..eae42ed 100644 --- a/README.markdown +++ b/README.markdown @@ -16,7 +16,7 @@ Want to use Golang to power your robots? Check out our sister project, ## Build Status: -[![Build Status](https://secure.travis-ci.org/hybridgroup/cylon.png?branch=master)](http://travis-ci.org/hybridgroup/cylon) +[![Build Status](https://secure.travis-ci.org/hybridgroup/cylon.png?branch=master)](http://travis-ci.org/hybridgroup/cylon) [![Code Climate](https://codeclimate.com/github/hybridgroup/cylon/coverage.png)](https://codeclimate.com/github/hybridgroup/cylon) ## Examples