File size: 2,731 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash

# Full skip argms
# npm run test-all -- --skip-changelog --skip-commit --skip-lint --skip-build --skip-dekko --skip-dist --skip-es --skip-lib --skip-test --skip-node

# Check exist argument
has_arg() {
  local term="$1"
  local start=0

  for arg in "$@"; do
    if [ $start -gt 0 ] && [ "$arg" == "$term" ]; then
      return 0 # Return 0 if argument exist
    fi

    start=$((start+1))
  done

  return 1 # Return 1 if argument not exist
}

if ! has_arg '--skip-changelog' "$@"; then
  echo "[TEST ALL] test changelog"
  echo "[TEST ALL] test changelog" > ~test-all.txt
  tsx ./scripts/check-version-md.ts
else
  echo "[TEST ALL] test changelog...skip"
fi

if ! has_arg '--skip-commit' "$@"; then
  echo "[TEST ALL] check-commit"
  echo "[TEST ALL] check-commit" > ~test-all.txt
  npm run check-commit
else
  echo "[TEST ALL] check-commit...skip"
fi

if ! has_arg '--skip-lint' "$@"; then
  echo "[TEST ALL] lint"
  echo "[TEST ALL] lint" > ~test-all.txt
  npm run lint
else
  echo "[TEST ALL] lint...skip"
fi

if ! has_arg '--skip-build' "$@"; then
  echo "[TEST ALL] dist"
  echo "[TEST ALL] dist" > ~test-all.txt
  npm run dist

  echo "[TEST ALL] compile"
  echo "[TEST ALL] compile" > ~test-all.txt
  npm run compile
else
  echo "[TEST ALL] build...skip"
fi

if ! has_arg '--skip-dekko' "$@"; then
  echo "[TEST ALL] dekko dist"
  echo "[TEST ALL] dekko dist" > ~test-all.txt
  tsx ./tests/dekko/dist.test.ts

  echo "[TEST ALL] dekko lib and es"
  echo "[TEST ALL] dekko lib and es" > ~test-all.txt
  tsx ./tests/dekko/lib-es.test.ts
else
  echo "[TEST ALL] dekko test...skip"
fi

if ! has_arg '--skip-dist' "$@"; then
  echo "[TEST ALL] dist test"
  echo "[TEST ALL] dist test" > ~test-all.txt
  LIB_DIR=dist npm test -- --bail
else
  echo "[TEST ALL] dist test...skip"
fi

if ! has_arg '--skip-dist' "$@"; then
  echo "[TEST ALL] dist-min test"
  echo "[TEST ALL] dist-min test" > ~test-all.txt
  LIB_DIR=dist-min npm test -- --bail
else
  echo "[TEST ALL] dist test...skip"
fi

if ! has_arg '--skip-es' "$@"; then
  echo "[TEST ALL] test es"
  echo "[TEST ALL] test es" > ~test-all.txt
  LIB_DIR=es npm test -- --bail
else
  echo "[TEST ALL] test es...skip"
fi

if ! has_arg '--skip-lib' "$@"; then
  echo "[TEST ALL] test lib"
  echo "[TEST ALL] test lib" > ~test-all.txt
  LIB_DIR=lib npm test -- --bail
else
  echo "[TEST ALL] test lib...skip"
fi

if ! has_arg '--skip-test' "$@"; then
  echo "[TEST ALL] test"
  echo "[TEST ALL] test" > ~test-all.txt
  npm test -- --bail
else
  echo "[TEST ALL] test...skip"
fi

if ! has_arg '--skip-node' "$@"; then
  echo "[TEST ALL] test node"
  echo "[TEST ALL] test node" > ~test-all.txt
  npm run test:node -- --bail
else
  echo "[TEST ALL] test node...skip"
fi