Skip to content

Commit 452a724

Browse files
chalinmhevery
authored andcommitted
chore(test): make it easier to run all JS and Dart tests
Performed a slight refactoring of CI scripts to make it easier for developers to run the **same** tests as those run on Travis. Defined `npm` scripts `test-js` and `test-dart`. `npm test` now runs the whole lot. Closes angular#966
1 parent 59a1f83 commit 452a724

File tree

6 files changed

+29
-9
lines changed

6 files changed

+29
-9
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
"url": "https://github.com/angular/angular.git"
2121
},
2222
"scripts": {
23-
"test": "echo \"Error: no test specified\" && exit 1",
24-
"postinstall": "bower install"
23+
"test": "npm run test-js && npm run test-dart",
24+
"test-js": "./scripts/ci/test_js.sh",
25+
"test-dart": "./scripts/ci/test_dart.sh",
26+
"postinstall": "./node_modules/.bin/bower install"
2527
},
2628
"dependencies": {
2729
"es6-module-loader": "^0.9.2",

scripts/ci/build_and_test.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,4 @@ SCRIPT_DIR=$(dirname $0)
99
cd $SCRIPT_DIR/../..
1010

1111
${SCRIPT_DIR}/build_$MODE.sh
12-
${SCRIPT_DIR}/test_unit_$MODE.sh
13-
if [ "$MODE" == "dart" ]; then # JS doesn't yet have server tests
14-
${SCRIPT_DIR}/test_server_$MODE.sh
15-
fi
16-
${SCRIPT_DIR}/test_e2e_$MODE.sh
12+
${SCRIPT_DIR}/test_$MODE.sh

scripts/ci/test_dart.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo =============================================================================
5+
# go to project dir
6+
SCRIPT_DIR=$(dirname $0)
7+
cd $SCRIPT_DIR/../..
8+
9+
${SCRIPT_DIR}/test_unit_dart.sh
10+
${SCRIPT_DIR}/test_server_dart.sh
11+
${SCRIPT_DIR}/test_e2e_dart.sh

scripts/ci/test_e2e_dart.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ trap killServer EXIT
2121
# wait for server to come up!
2222
sleep 10
2323

24-
./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=$E2E_BROWSERS
24+
./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=${E2E_BROWSERS:-Dartium}

scripts/ci/test_e2e_js.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ trap killServer EXIT
2121
# wait for server to come up!
2222
sleep 10
2323

24-
./node_modules/.bin/protractor protractor-js.conf.js --browsers=$E2E_BROWSERS
24+
./node_modules/.bin/protractor protractor-js.conf.js --browsers=${E2E_BROWSERS:-Dartium}

scripts/ci/test_js.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo =============================================================================
5+
# go to project dir
6+
SCRIPT_DIR=$(dirname $0)
7+
cd $SCRIPT_DIR/../..
8+
9+
${SCRIPT_DIR}/test_unit_js.sh
10+
# ${SCRIPT_DIR}/test_server_js.sh # JS doesn't yet have server tests
11+
${SCRIPT_DIR}/test_e2e_js.sh

0 commit comments

Comments
 (0)