forked from digitalbazaar/jsonld.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (51 loc) · 1.93 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
60
61
62
63
64
65
66
TESTS = tests/test.js
REPORTER = spec
all:
test: test-node test-browser test-local-node test-local-browser test-normalization-node test-normalization-browser test-meteor-integration
test-suite: test-suite-node test-suite-browser
test-suite-node:
@if [ "x$(JSONLD_TEST_SUITE)" = x ]; then \
echo "Error: JSONLD_TEST_SUITE env var not set"; \
exit 1; \
fi
@if [ -d $(JSONLD_TEST_SUITE) ]; then \
NODE_ENV=test ./node_modules/.bin/mocha -A -R $(REPORTER) $(TESTS); \
else \
echo "Error: tests not found at $(JSONLD_TEST_SUITE)"; \
exit 1; \
fi
test-suite-browser:
@if [ "x$(JSONLD_TEST_SUITE)" = x ]; then \
echo "Error: JSONLD_TEST_SUITE env var not set"; \
exit 1; \
fi
@if [ -d $(JSONLD_TEST_SUITE) ]; then \
NODE_ENV=test ./node_modules/.bin/phantomjs $(TESTS); \
else \
echo "Error: tests not found at $(JSONLD_TEST_SUITE)"; \
exit 1; \
fi
test-node:
@JSONLD_TEST_SUITE=../json-ld.org/test-suite $(MAKE) test-suite-node
test-browser:
@JSONLD_TEST_SUITE=../json-ld.org/test-suite $(MAKE) test-suite-browser
test-local-node:
@JSONLD_TEST_SUITE=./tests/new-embed-api $(MAKE) test-suite-node
test-local-browser:
@JSONLD_TEST_SUITE=./tests/new-embed-api $(MAKE) test-suite-browser
test-normalization-node:
@JSONLD_TEST_SUITE=../normalization/tests $(MAKE) test-suite-node
test-normalization-browser:
@JSONLD_TEST_SUITE=../normalization/tests $(MAKE) test-suite-browser
test-meteor-integration:
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
npm install spacejam
cp ./meteor/package.js ./package.js
PATH=~/.meteor:$$PATH ./node_modules/.bin/spacejam test-packages ./
rm ./package.js
test-coverage:
./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
-u exports -R $(REPORTER) $(TESTS)
clean:
rm -rf coverage
.PHONY: test test-node test-browser test-local-node test-local-browser test-normalization-node test-normalization-browser test-meteor-integration test-coverage clean