-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
59 lines (46 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# DemocracyOS Makefile
#
BABEL="./node_modules/.bin/babel-node"
MOCHA="./node_modules/.bin/mocha"
ESLINT="./node_modules/eslint/bin/eslint.js"
ifndef DEBUG
DEBUG="api-starter*"
endif
ifndef NODE_ENV
NODE_ENV="development"
endif
# Installs deps & runs server with your custom code
run: install
@echo "Starting API server..."
@NODE_PATH=. DEBUG=$(DEBUG) $(BABEL) index.js
# Runs mocha on basic tests (must have main server running)
test:
@echo "Starting tests..."
@NODE_PATH=. $(MOCHA) --compilers js:babel/register ./test/index.test.js
@echo "Done testing.\n"
# Installs deps
install:
@echo "Installing dependencies..."
@npm install
@echo "Done installing dependencies.\n"
# Runs ESLint
lint:
@echo "Running code linter... \n"
@$(ESLINT) *.js lib
@echo "Done.\n"
# Installs deps & runs example server
example: install
@echo "Starting example API..."
@NODE_PATH=. DEBUG=$(DEBUG) $(BABEL) examples/index.js
# Runs mocha on example tests (must have example running)
test-example:
@echo "Starting tests..."
@NODE_PATH=. $(MOCHA) --compilers js:babel/register ./test/example.test.js
@echo "Done testing.\n"
# Cleans deps
clean:
@echo "Cleaning up..."
@rm -rf node_modules
@echo "Done cleaning up.\n"
.PHONY: clean test install