-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcover
executable file
·52 lines (41 loc) · 1.45 KB
/
cover
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
#!/usr/bin/env bash
set -u
# ${SNUGGSI?"🔴 Set shell variable to installation location"}
declare -r THRESHOLD=100 # Percentage
declare -r EXTENSIONS='.es' # Ecmascript
declare -r HARNESS="node --test index.test.es **/*.test.es **/*.test.js" # Test harness
declare -r OUTPUT=.nyc_output/ # Represented in Percentage
declare -r REPORTER=text # Type of coverage report to generate
declare -r COVER=$SNUGGSI/node_modules/.bin/nyc # Coverage runner
declare -r CHECK="$COVER --check-coverage" # Coverage checker
declare -r EXCLUDE='{middleware,resource,server}/**' # + test(s) & node_modules
declare -r LIBRARIES='./watch/*.es'
echo "📊 snuggsi ツ Coverage Report"
echo
echo " 🎯 Threshold 👉 $THRESHOLD %"
echo " ⚙️ Cover 👉 $COVER"
echo " ➕ Included 👉 $LIBRARIES"
echo " ➖ Excluded 👉 $EXCLUDE"
echo
# --all
# --show-process-tree
# --include $LIBRARIES
$CHECK \
--exclude $EXCLUDE \
--lines $THRESHOLD \
--branches $THRESHOLD \
--functions $THRESHOLD \
--statements $THRESHOLD \
--clean --per-file \
--exclude-node-modules \
--extension $EXTENSIONS \
$HARNESS
declare -r CODE=$?
# echo
# echo "📁 Coverage Cleanup"
# echo " ⚠️ Removing coverage report artifacts."
# echo " 👇 "
# echo " 🚮 Removing 👉 $OUTPUT"
# echo # Remove output directory
# rm -rf $OUTPUT
exit $CODE