extract the test target

This commit is contained in:
Jesse Hallam 2018-07-25 14:24:46 -04:00
parent 68cf434afb
commit b3b2250076
No known key found for this signature in database
GPG key ID: E7959EB6518AF966

View file

@ -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: