Skip to content

Commit 9b61f70

Browse files
committed
Implement Vuex tests
1 parent 5b74a9c commit 9b61f70

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

tests/test_store.sh

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
11
#!/usr/bin/env bash
22

3-
set -e
3+
set -ev
44

55
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6-
cd "$DIR"
6+
cd "$DIR/output"
77

8-
echo "$DIR"
98
echo "Checking Vuex..."
9+
10+
if ! grep -q "vuex" package.json; then
11+
echo "Vuex not found in package.json"
12+
cat packages.json
13+
exit 1
14+
fi;
15+
16+
test -f src/store/actions.js
17+
test -f src/store/getters.js
18+
test -f src/store/index.js
19+
test -f src/store/mutation-types.js
20+
test -f src/store/mutations.js
21+
22+
if ! grep -ql "^import store from './store';$" src/background.js; then
23+
echo "Line « import store from './store'; » not found in src/background.js"
24+
cat src/background.js
25+
exit 2
26+
fi;
27+
28+
if ! grep -ql "^import store from './../store';$" src/popup/popup.js; then
29+
echo "Line « import store from './../store'; » not found in src/popup/popup.js"
30+
cat src/popup/popup.js
31+
exit 2
32+
fi;
33+
34+
if ! grep -ql "^[[:space:]][[:space:]]store,$" src/popup/popup.js; then
35+
echo "Line « store, » not found in src/popup/popup.js"
36+
cat src/popup/popup.js
37+
exit 2
38+
fi;

0 commit comments

Comments
 (0)