summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorJulien Dessaux2023-01-01 23:23:57 +0100
committerJulien Dessaux2023-01-02 20:26:28 +0100
commit3acf783d948ebb1907da875ef87b0da9ef2309ff (patch)
tree06b805fab10e638a9f5e66714ef4a29b6409c1e7 /GNUmakefile
parentRefactored game creation (diff)
downloadjeux-de-mots-3acf783d948ebb1907da875ef87b0da9ef2309ff.tar.gz
jeux-de-mots-3acf783d948ebb1907da875ef87b0da9ef2309ff.tar.bz2
jeux-de-mots-3acf783d948ebb1907da875ef87b0da9ef2309ff.zip
Began adding tests
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile
index c245c63..6e16807 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -2,8 +2,8 @@ PATH:=$(PATH):$(PWD)/node_modules/.bin
SHELL:=bash
.PHONY: check
-check: ## make check # Check syntax of eventline jobs
- eslint main.js
+check: ## make check # Check syntax of entry points
+ eslint main.js test.js test/
(cd static; eslint index.js)
.PHONY: init
@@ -12,12 +12,19 @@ init: ## make init # initialize project dependencies
.PHONY: serve
serve: ## make serve # run a self reloading nodejs web server
- nodemon main.js
+ NODE_ENV=development nodemon main.js
.PHONY: run
run: ## make run # run a production nodejs web server
NODE_ENV=production node main.js
+.PHONY: test
+test: check ## make test # run tests
+ @rm -f testjdm.db testsessions.db
+ NODE_ENV=test node test.js
+ NODE_ENV=test ava --watch test/
+ @rm -f testjdm.db testsessions.db
+
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'