Permalink
Browse files

add coveralls

  • Loading branch information...
1 parent 1cc13c0 commit b7e9783d2c4e9734b0be5531bf2607e86a444c98 @guileen guileen committed Feb 15, 2014
Showing with 32 additions and 44 deletions.
  1. +1 −0 .travis.yml
  2. +13 −38 Makefile
  3. +15 −5 package.json
  4. +3 −1 test/mocha.opts
View
1 .travis.yml
@@ -3,5 +3,6 @@ node_js:
- 0.6
- 0.8
- 0.10
+script: make coveralls
services:
- mongodb
View
51 Makefile
@@ -1,46 +1,21 @@
-TESTS = test/
-TESTTIMEOUT = 1000
-REPORTER = spec
-MOCHA_OPTS =
-PROJECT_DIR = $(shell pwd)
MONGOSKIN_REPLICASET = false
-JSCOVERAGE = ./node_modules/jscover/bin/jscover
-SUPPORT_VERSIONS := \
- 1.0.0 1.0.1 1.0.2 \
- 1.1.0-beta 1.1.1 1.1.2 1.1.3 1.1.4
-node_modules:
- @npm install
+NODE_BIN=./node_modules/.bin
+MOCHA=$(NODE_BIN)/mocha
+COVERALLS=$(NODE_BIN)/coveralls
-deps/mongodb:
- git clone git://github.com/mongodb/node-mongodb-native.git deps/mongodb; \
- @cd deps/mongodb && npm install && git pull
-
-test: node_modules deps/mongodb
- @NODE_ENV=test MONGOSKIN_REPLICASET=$(MONGOSKIN_REPLICASET) \
- ./node_modules/mocha/bin/mocha --recursive \
- --reporter $(REPORTER) --timeout $(TESTTIMEOUT) \
- $(MOCHA_OPTS) $(TESTS)
-
-test-debug:
- @$(MAKE) test MOCHA_OPTS="--debug-brk"
+test:
+ @$(MOCHA) -R spec
test-replicaset:
- @$(MAKE) test MONGOSKIN_REPLICASET=true
+ @MONGOSKIN_REPLICASET=true $(MOCHA)
-lib-cov:
- @rm -rf $@
- @$(JSCOVERAGE) lib $@
+test-cov:
+ @$(MOCHA) -R html-cov > coverage.html
-test-cov: lib-cov
- @MONGOSKIN_COV=1 $(MAKE) test REPORTER=dot
- @MONGOSKIN_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
- @$(MAKE) test REPORTER=markdown > test_results.md
+coveralls:
+ @$(MOCHA) -R mocha-lcov-reporter | $(COVERALLS)
-test-version:
- @for version in $(SUPPORT_VERSIONS); do \
- echo "test with mongodb@$$version"; \
- npm install mongodb@$$version --loglevel=warn; \
- $(MAKE) test REPORTER=dot; \
- done
+test-watch:
+ @$(MOCHA) -w -R dot --growl
-.PHONY: test-replicaset test-version test-cov test lib-cov
+.PHONY: test-cov test-replicaset test
View
20 package.json
@@ -21,16 +21,26 @@
"node": ">= 0.4.0"
},
"dependencies": {
- "mongodb": "1.3.20",
- "mocha": "~1.17.1"
+ "mongodb": "1.3.20"
},
"devDependencies": {
- "mocha": "*",
- "jscover": "*",
+ "mocha": "~1.17.1",
+ "blanket": "~1.1.6",
+ "coveralls": "~2.8.0",
+ "mocha-lcov-reporter": "0.0.1",
+ "travis-cov": "~0.2.5",
"should": "1.2.2"
},
+ "config": {
+ "blanket": {
+ "pattern": "mongoskin/lib"
+ },
+ "travis-cov": {
+ "threshold": 95
+ }
+ },
"scripts": {
- "test": "mocha -R spec --recursive"
+ "test": "./node_modules/.bin/mocha -R travis-cov"
},
"directories": {
"example": "./examples",
View
4 test/mocha.opts
@@ -1,2 +1,4 @@
+-R spec
+--require blanket
--require should
---growl
+--timeout 500

0 comments on commit b7e9783

Please sign in to comment.