From 974536c66975e7bd410dc1ca62ea67fc4efbdfc9 Mon Sep 17 00:00:00 2001 From: Simon Ho Date: Tue, 24 Nov 2015 21:52:44 -0800 Subject: [PATCH] Refactor Makefile --- Makefile | 34 +++++++++++++++++++++------------- package.json | 1 + 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 91f7f91d..009bcf3a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/package.json b/package.json index 113b839a..4ff7e6d3 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "depd": "./lib/browser.depd.js" }, "scripts": { + "help": "make help", "test": "make test" }, "engines": [