/
test.sh
executable file
·72 lines (57 loc) · 1.13 KB
/
test.sh
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
67
68
69
70
71
72
#!/bin/sh
# Automated tests
set -e
MODE=$1
run_lint() {
npm run lint
markdownlint docs
}
run_full_test() {
run_lint
node test/start.js test
node test/start.js test-browser
node test/start.js render
}
case $MODE in
"full")
run_full_test;
break;;
"fast")
npm run lint pre-commit
node test/start.js test
break;;
"bench")
node test/start.js bench
node test/start.js bench-browser
break;;
"ci")
# run by Travis CI
node test/start.js test-ci
npm run build
npm run collect-metrics
break;;
"cover")
NODE_ENV=test tape -r babel-register test/node.js
nyc report
break;;
"dist")
npm run build
node test/start.js test-dist
break;;
"examples")
node test/node-examples.js
break;;
"lint")
run_lint
break;;
"size-es6")
npm run build
NODE_ENV=production webpack --config test/webpack.config.js --env.import-nothing --env.es6
break;;
*)
# default test
echo "test [ 'full' | fast' | 'bench' | 'ci' | 'cover' | 'examples' | 'lint' | size-es6' ]"
echo "Running 'full' test by default"
run_full_test
;;
esac