Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 26 lines (20 sloc) 0.875 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# use the tools as dev dependencies rather than installing them globaly
# it lets you handle specific versions of the tooling for each of your projects
MOCHA=node_modules/.bin/mocha
ISTANBUL=node_modules/.bin/istanbul
JSHINT=node_modules/.bin/jshint

# test files must end with ".test.js"
TESTS=$(shell find test/ -name "*.test.js")

_MOCHA="node_modules/.bin/_mocha"
coverage:
@# check if reports folder exists, if not create it
@test -d reports || mkdir reports
$(ISTANBUL) cover --report lcovonly --dir ./reports $(_MOCHA) -- -R spec --colors $(TESTS)
genhtml reports/lcov.info --output-directory reports/

jshint:
$(JSHINT) lib test --show-non-errors

checkstyle:
@# check if reports folder exists, if not create it
@test -d reports || mkdir reports
$(JSHINT) lib test --reporter=checkstyle > reports/checkstyle.xml

.PHONY: clean test coverage jshint checkstyle
Something went wrong with that request. Please try again.