From b3b225007694a6232448f4d914367eb8b4e6f723 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Wed, 25 Jul 2018 14:24:46 -0400 Subject: [PATCH] extract the test target --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cadd654..b9c78dd 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,8 @@ HAS_SERVER=$(shell build/bin/manifest has_server) # Determine if a webapp is defined in plugin.json HAS_WEBAPP=$(shell build/bin/manifest has_webapp) -# all, the default target, builds and bundle the plugin. -all: dist +# all, the default target, tests, builds and bundles the plugin. +all: test dist # apply propagates the plugin id into the server/ and webapp/ folders as required. .PHONY: apply @@ -51,7 +51,6 @@ endif .PHONY: webapp webapp: webapp/.npminstall ifneq ($(HAS_WEBAPP),) - cd webapp && npm run fix; cd webapp && npm run build; endif @@ -101,6 +100,16 @@ else @echo "No supported deployment method available. Install plugin manually." endif +# test runs any lints and unit tests defined for the server and webapp, if they exist +.PHONY: test +test: +ifneq ($(HAS_SERVER),) + cd server && $(GO) test ./... +endif +ifneq ($(HAS_WEBAPP),) + cd webapp && npm run fix; +endif + # clean removes all build artifacts .PHONY: clean clean: