File tree Expand file tree Collapse file tree 6 files changed +141
-0
lines changed
Expand file tree Collapse file tree 6 files changed +141
-0
lines changed Original file line number Diff line number Diff line change 1+ sudo : required
2+ dist : trusty
3+
4+ language : node_js
5+
6+ node_js :
7+ - " 6"
8+
9+ env :
10+ - USE_AXIOS=true USE_ROUTER=true USE_VUEX=true
11+ - USE_AXIOS=false USE_ROUTER=false USE_VUEX=false
12+
13+ - USE_AXIOS=true USE_ROUTER=false USE_VUEX=false
14+ - USE_AXIOS=false USE_ROUTER=true USE_VUEX=false
15+ - USE_AXIOS=false USE_ROUTER=false USE_VUEX=true
16+
17+ before_install :
18+ # Remove the MongoDB repo as their GPG key has expired.
19+ - sudo rm /etc/apt/sources.list.d/mongodb-3.4.list
20+ # APT
21+ - sudo apt -qq update
22+ - sudo apt install -y expect
23+ # Yarn
24+ - curl -o- -L https://yarnpkg.com/install.sh | bash
25+ - export PATH="$HOME/.yarn/bin:$PATH"
26+ - yarn global add vue-cli
27+
28+ before_script :
29+ - cd tests
30+ - ./generate_extension.exp
31+ - cd output
32+ - yarn
33+ - yarn build
34+ - cd ..
35+
36+ script :
37+ - if [ $USE_AXIOS = "true" ]; then ./test_axios.sh; else echo "Will not testing Axios..."; fi;
38+ - if [ $USE_ROUTER = "true" ]; then ./test_router.sh; else echo "Will not testing Vue-Router..."; fi;
39+ - if [ $USE_VUEX = "true" ]; then ./test_store.sh; else echo "Will not testing Vuex..."; fi;
Original file line number Diff line number Diff line change 1+ output /
Original file line number Diff line number Diff line change 1+ #!/usr/bin/expect
2+
3+ spawn vue init kocal/vue-web-extension output
4+
5+ expect "Project name" { send "output\n"}
6+ expect "Project description" { send "The description of my wonderful extension\n" }
7+ expect "Author" { send "John Smith <john@smith.com>\n" }
8+
9+ set choice [expr $::env(USE_ROUTER) == true ? "y" : "n"]
10+ expect "Install vue-router?" { send "$choice\n" }
11+
12+ set choice [expr $::env(USE_VUEX) == true ? "y" : "n"]
13+ expect "Install vuex?" {send "$choice\n" }
14+
15+ set choice [expr $::env(USE_AXIOS) == true ? "y" : "n"]
16+ expect "Install axios?" { send "$choice\n" }
17+
18+ expect "vue-cli · Generated" { send "\n"}
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -ev
4+
5+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
6+ cd " $DIR /output"
7+
8+ echo " Checking Axios..."
9+
10+ if ! grep -q " axios" package.json; then
11+ echo " Axios not found in package.json"
12+ cat package.json
13+ exit 1
14+ fi ;
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -ev
4+
5+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
6+ cd " $DIR /output"
7+
8+ echo " Checking Vue-Router..."
9+
10+ if ! grep -q " vue-router" package.json; then
11+ echo " Vue-Router not found in package.json"
12+ cat packages.json
13+ exit 1
14+ fi ;
15+
16+ test -f src/popup/router/pages/Index.vue
17+ test -f src/popup/router/index.js
18+ test -f src/popup/router/routes.js
19+
20+ if ! grep -ql " ^import router from './router';$" src/popup/popup.js; then
21+ echo " Line « import router from './router'; » not found in src/popup/popup.js"
22+ cat src/popup/popup.js
23+ exit 2
24+ fi ;
25+
26+ if ! grep -ql " ^[[:space:]][[:space:]]router,$" src/popup/popup.js; then
27+ echo " Line « router, » not found in src/popup/popup.js"
28+ cat src/popup/popup.js
29+ exit 2
30+ fi ;
31+
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -ev
4+
5+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
6+ cd " $DIR /output"
7+
8+ 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 ;
You can’t perform that action at this time.
0 commit comments