Refactor Makefile

This commit is contained in:
Simon Ho 2015-11-24 21:52:44 -08:00
parent b8fb67beb5
commit 974536c669
2 changed files with 22 additions and 13 deletions

View File

@ -1,25 +1,33 @@
## TESTS
TESTER = ./node_modules/.bin/mocha
OPTS = --growl
TESTS = test/*.test.js
default: help
.PHONY: help
help:
@echo 'Usage: make [target]'
@echo 'Targets:'
@echo ' help Print help (this message)'
@echo ' test Run tests in silent mode'
@echo ' test-verbose Run tests in verbose mode'
@echo ' testing Run tests continuously'
.PHONY: test
test:
NO_DEPRECATION=loopback-datasource-juggler $(TESTER) $(OPTS) $(TESTS)
.PHONY: test-verbose
test-verbose:
$(TESTER) $(OPTS) --reporter spec $(TESTS)
.PHONY: testing
testing:
$(TESTER) $(OPTS) --watch $(TESTS)
# Deprecated targets
.PHONY: about-testing
about-testing:
@echo "\n## TESTING\n"
@echo " make test # Run all tests in silent mode"
@echo " make test-verbose # Run all tests in verbose mode"
@echo " make testing # Run tests continuously"
## HELP
help: about-testing
.PHONY: test
@echo 'DEPRECATED: Use `make help` instead'
make help

View File

@ -20,6 +20,7 @@
"depd": "./lib/browser.depd.js"
},
"scripts": {
"help": "make help",
"test": "make test"
},
"engines": [