Skip to content
This repository was archived by the owner on Aug 27, 2020. It is now read-only.

Commit 14c9bd9

Browse files
committed
Add library option tests
1 parent ae1c296 commit 14c9bd9

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed

tests/js-library.expect

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
set testname [lindex $argv 0];
2+
spawn ../node_modules/.bin/vue init .. $testname
3+
4+
expect "Project name"
5+
send "\n"
6+
expect "Project description"
7+
send "\n"
8+
expect "Author"
9+
send "\n"
10+
expect "Project type"
11+
send "\[B"
12+
expect "Library"
13+
send "\n"
14+
expect "Vue build"
15+
send "\n"
16+
expect "Install vue-router?"
17+
send "\n"
18+
expect "Which language do you want to use?"
19+
send "\[B"
20+
expect "ES2015"
21+
send "\n"
22+
expect "Use ESLint to lint your JavaScript code?"
23+
send "\n"
24+
expect "Pick an ESLint preset"
25+
send "\n"
26+
expect "Use TSLint to lint your TypeScript code?"
27+
send "\n"
28+
expect "Pick a TSLint preset"
29+
send "\n"
30+
expect "Setup unit tests with Karma + Mocha?"
31+
send "\n"
32+
expect "Setup e2e tests with Nightwatch?"
33+
send "\n"
34+
expect eof

tests/js-library.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
testname=$1
4+
5+
if [[ -z $testname ]]; then
6+
echo "No test name given"
7+
exit -1;
8+
fi
9+
10+
if [[ "$testname" == *\/* ]] || [[ "$testname" == *\\* ]]; then
11+
echo "Invalid test name"
12+
exit -1;
13+
fi
14+
15+
rm -Rf "$testname"
16+
17+
expect "$testname.expect" "$testname"
18+
19+
echo "Testing $testname"
20+
cd $testname
21+
npm install
22+
npm run eslint
23+
npm test
24+
npm run build
25+
cd ..

tests/library.expect

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
set testname [lindex $argv 0];
2+
spawn ../node_modules/.bin/vue init .. $testname
3+
4+
expect "Project name"
5+
send "\n"
6+
expect "Project description"
7+
send "\n"
8+
expect "Author"
9+
send "\n"
10+
expect "Project type"
11+
send "\[B"
12+
expect "Library"
13+
send "\n"
14+
expect "Vue build"
15+
send "\n"
16+
expect "Install vue-router?"
17+
send "\n"
18+
expect "Which language do you want to use?"
19+
send "\n"
20+
expect "Use ESLint to lint your JavaScript code?"
21+
send "\n"
22+
expect "Pick an ESLint preset"
23+
send "\n"
24+
expect "Use TSLint to lint your TypeScript code?"
25+
send "\n"
26+
expect "Pick a TSLint preset"
27+
send "\n"
28+
expect "Setup unit tests with Karma + Mocha?"
29+
send "\n"
30+
expect "Setup e2e tests with Nightwatch?"
31+
send "\n"
32+
expect eof

tests/library.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
testname=$1
4+
5+
if [[ -z $testname ]]; then
6+
echo "No test name given"
7+
exit -1;
8+
fi
9+
10+
if [[ "$testname" == *\/* ]] || [[ "$testname" == *\\* ]]; then
11+
echo "Invalid test name"
12+
exit -1;
13+
fi
14+
15+
rm -Rf "$testname"
16+
17+
expect "$testname.expect" "$testname"
18+
19+
echo "Testing $testname"
20+
cd $testname
21+
npm install
22+
npm run eslint
23+
npm run tslint
24+
npm test
25+
npm run build
26+
cd ..

0 commit comments

Comments
 (0)