forked from csscomb/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·44 lines (37 loc) · 780 Bytes
/
test.sh
File metadata and controls
executable file
·44 lines (37 loc) · 780 Bytes
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
#!/bin/bash
EXIT_CODE=0
function test {
"$@"
if [ $? -ne 0 ]; then
EXIT_CODE=1
fi
}
# Run linters
printf "\n\
----------------\n\
Running JSHint\n\
----------------\n\n"
test ./node_modules/.bin/jshint ./src
printf "\n\
--------------\n\
Running JSCS\n\
--------------\n\n"
test ./node_modules/.bin/jscs ./src
# Run tests
printf "\n\
---------------\n\
Running Mocha\n\
---------------\n\n"
test ./node_modules/.bin/mocha
if [ $EXIT_CODE -ne 0 ]; then
printf "\n\
----------------------------------------------------\n\
Please, fix errors shown above and run tests again\n\
----------------------------------------------------\n"
else
printf "\n\
------------------------\n\
Everything looks fine!\n\
------------------------\n"
fi
exit $EXIT_CODE