Skip to content

Commit

Permalink
Test code coverage & Travis sends to coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jun 20, 2015
1 parent 7fed512 commit 1dd4c7e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_STORE
node_modules
coverage
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ README.md
changelog.md
Makefile
TODO.md
coverage
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ language: node_js
node_js:
- "0.10"

matrix:
fast_finish: true
include:
- node_js: "0.10"
env:
- TEST_SUITE=test
- COVERAGE=true
allow_failures:
- env:
- TEST_SUITE=test
- COVERAGE=true

branches:
only:
- master
Expand Down
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ teaser:
node -pe "Array(18).join('#')" && \
echo ''

ifeq (true,$(COVERAGE))
test:
make coveralls
test-harmony:
make coveralls-harmony
else
test:
make tests
test-harmony:
make tests-harmony
endif

tests:
@if [ "$$GREP" ]; then \
make jshint && make teaser && ./node_modules/mocha/bin/mocha --check-leaks --colors -t 10000 --reporter $(REPORTER) -g "$$GREP" $(TESTS); \
else \
Expand All @@ -20,4 +32,14 @@ test:
jshint:
./node_modules/.bin/jshint lib defaults/controllers defaults/models

.PHONY: test
cover:
make teaser; \
./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec $(TESTS); \
rm -rf coverage

coveralls:
./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec; \
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js; \
rm -rf ./coverage

.PHONY: test tests cover coveralls
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
[![Build Status](https://img.shields.io/travis/overlookmotel/overlook-framework/master.svg)](http://travis-ci.org/overlookmotel/overlook-framework)
[![Dependency Status](https://img.shields.io/david/overlookmotel/overlook-framework.svg)](https://david-dm.org/overlookmotel/overlook-framework)
[![Dev dependency Status](https://img.shields.io/david/dev/overlookmotel/overlook-framework.svg)](https://david-dm.org/overlookmotel/overlook-framework)
[![Coverage Status](https://img.shields.io/coveralls/overlookmotel/overlook-framework/master.svg)](https://coveralls.io/r/overlookmotel/overlook-framework)

## Usage

NOT READY FOR USE YET

## Tests

Use `npm test` to run the tests.
Use `npm test` to run the tests. Use `npm run cover` to check coverage.

## Changelog

Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ No changes. Erroneous version bump.
* Remove all transaction passing (now handled by CLS)
* Update dependencies
* Update dev dependencies
* Test code coverage & Travis sends to coveralls
* Disable Travis dependency cache
* Travis runs on new container infrastructure
* Update README badges to use shields.io
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
"mocha": "^2.2.4",
"chai": "^2.3.0",
"chai-as-promised": "^5.0.0",
"jshint": "^2.7.0"
"jshint": "^2.7.0",
"istanbul": "^0.3.14",
"coveralls": "^2.11.2"
},
"keywords": [
],
"scripts": {
"test": "make test"
"test": "make test",
"cover": "make cover"
},
"engines": {
"node": ">=0.10.0"
Expand Down

0 comments on commit 1dd4c7e

Please sign in to comment.