2014-02-27 22:44:53 +08:00
|
|
|
BIN := ./node_modules/.bin
|
2014-04-26 00:13:09 +08:00
|
|
|
TEST_FILES := test/support.js $(shell find test/specs -type f -name "*.js")
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-03-29 03:29:33 +08:00
|
|
|
VERSION := $(shell node -e "console.log(require('./package.json').version)")
|
|
|
|
|
2014-02-27 22:44:53 +08:00
|
|
|
# Our 'phony' make targets (don't involve any file changes)
|
2014-05-22 10:35:09 +08:00
|
|
|
.PHONY: cover test bdd lint release
|
|
|
|
|
|
|
|
# Run Mocha, with coverage.
|
|
|
|
cover:
|
|
|
|
@$(BIN)/istanbul cover $(BIN)/_mocha $(TEST_FILES) --report lcovonly -- -R spec
|
2014-02-27 22:44:53 +08:00
|
|
|
|
|
|
|
# Run Mocha, with standard reporter.
|
|
|
|
test:
|
2014-02-28 01:41:47 +08:00
|
|
|
@$(BIN)/mocha --colors $(TEST_FILES)
|
2014-02-27 22:44:53 +08:00
|
|
|
|
|
|
|
# Run Mocha, with more verbose BDD reporter.
|
|
|
|
bdd:
|
2014-02-28 01:41:47 +08:00
|
|
|
@$(BIN)/mocha --colors -R spec $(TEST_FILES)
|
2014-02-27 22:44:53 +08:00
|
|
|
|
|
|
|
# Run JSHint
|
|
|
|
lint:
|
|
|
|
@$(BIN)/jshint ./lib
|
2014-03-29 03:29:33 +08:00
|
|
|
|
|
|
|
# Cuts/publishes a new release
|
|
|
|
release:
|
|
|
|
@git tag -m "$(VERSION)" v$(VERSION)
|
|
|
|
@git push --tags
|
|
|
|
@npm publish ./
|