Skip to content

Commit

Permalink
Merge pull request #653 from JacksonTian/coverage
Browse files Browse the repository at this point in the history
Add make coverage command to get test coverage info
  • Loading branch information
3rd-Eden committed Apr 11, 2016
2 parents 4f99812 + de00809 commit a7ea2b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ node_modules
.*.swp
.lock-*
build
coverage

builderror.log
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
ALL_TESTS = $(shell find test/ -name '*.test.js')
ALL_INTEGRATION = $(shell find test/ -name '*.integration.js')

all:
node-gyp configure build

clean:
node-gyp clean

run-tests:
@./node_modules/.bin/mocha \
-t 5000 \
Expand All @@ -21,12 +15,23 @@ run-integrationtests:
$(TESTFLAGS) \
$(TESTS)

run-coverage:
@./node_modules/.bin/istanbul cover --report html \
./node_modules/.bin/_mocha -- \
-t 5000 \
-s 6000 \
$(TESTFLAGS) \
$(TESTS)

test:
@$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests

integrationtest:
@$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_INTEGRATION)" run-integrationtests

coverage:
@$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_TESTS)" run-coverage

benchmark:
@node bench/sender.benchmark.js
@node bench/parser.benchmark.js
Expand All @@ -37,4 +42,4 @@ autobahn:
autobahn-server:
@NODE_PATH=lib node test/autobahn-server.js

.PHONY: test
.PHONY: test coverage
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"benchmark": "0.3.x",
"bufferutil": "1.2.x",
"expect.js": "0.3.x",
"istanbul": "^0.4.1",
"mocha": "2.3.x",
"should": "8.0.x",
"tinycolor": "0.0.x",
Expand Down

0 comments on commit a7ea2b1

Please sign in to comment.