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 #966
This commit is contained in:
Patrice Chalin 2015-03-15 13:51:41 -07:00 committed by Misko Hevery
parent 59a1f836a2
commit 452a724542
6 changed files with 29 additions and 9 deletions

View File

@ -20,8 +20,10 @@
"url": "https://github.com/angular/angular.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "bower install"
"test": "npm run test-js && npm run test-dart",
"test-js": "./scripts/ci/test_js.sh",
"test-dart": "./scripts/ci/test_dart.sh",
"postinstall": "./node_modules/.bin/bower install"
},
"dependencies": {
"es6-module-loader": "^0.9.2",

View File

@ -9,8 +9,4 @@ SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
${SCRIPT_DIR}/build_$MODE.sh
${SCRIPT_DIR}/test_unit_$MODE.sh
if [ "$MODE" == "dart" ]; then # JS doesn't yet have server tests
${SCRIPT_DIR}/test_server_$MODE.sh
fi
${SCRIPT_DIR}/test_e2e_$MODE.sh
${SCRIPT_DIR}/test_$MODE.sh

11
scripts/ci/test_dart.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
${SCRIPT_DIR}/test_unit_dart.sh
${SCRIPT_DIR}/test_server_dart.sh
${SCRIPT_DIR}/test_e2e_dart.sh

View File

@ -21,4 +21,4 @@ trap killServer EXIT
# wait for server to come up!
sleep 10
./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=$E2E_BROWSERS
./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=${E2E_BROWSERS:-Dartium}

View File

@ -21,4 +21,4 @@ trap killServer EXIT
# wait for server to come up!
sleep 10
./node_modules/.bin/protractor protractor-js.conf.js --browsers=$E2E_BROWSERS
./node_modules/.bin/protractor protractor-js.conf.js --browsers=${E2E_BROWSERS:-Dartium}

11
scripts/ci/test_js.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
${SCRIPT_DIR}/test_unit_js.sh
# ${SCRIPT_DIR}/test_server_js.sh # JS doesn't yet have server tests
${SCRIPT_DIR}/test_e2e_js.sh