Merge pull request #91 from JacksonTian/cov

Use istanbul for test coverage
This commit is contained in:
李成银 2014-07-22 16:59:05 +08:00
commit cd72215be0
3 changed files with 9 additions and 12 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@ sftp-config.json
diff
log
npm-debug.log
test/App/Runtime/Cache/
test/App/Runtime/Cache/
coverage

View File

@ -2,21 +2,23 @@ TESTS = test/test/*.js
REPORTER = spec
TIMEOUT = 10000
MOCHA_OPTS =
ISTANBUL = ./node_modules/.bin/istanbul
MOCHA = ./node_modules/mocha/bin/_mocha
install:
@npm install
test: install
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
@NODE_ENV=test ./node_modules/jshint/bin/jshint lib/
test-cov:
@URLRAR_COV=1 $(MAKE) test MOCHA_OPTS='--require blanket -R html-cov > coverage.html'
@$(ISTANBUL) cover --report html $(MOCHA) -- -t $(TIMEOUT) -R spec $(TESTS)
test-all: test test-cov
.PHONY: test-cov test test-all
.PHONY: test-cov test test-all

View File

@ -24,17 +24,11 @@
"websocket": "1.0.8"
},
"devDependencies": {
"blanket": "1.1.6",
"should": "4.0.4",
"jshint": "2.5.1",
"mocha": "1.20.1",
"muk": "0.3.1"
},
"config": {
"blanket": {
"pattern": "/thinkjs/lib/",
"data-cover-never": "node_modules"
}
"muk": "0.3.1",
"istanbul": "*"
},
"keywords": [
"thinkjs",