2016-04-28 20:50:03 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
set -u -e -o pipefail
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
# Setup environment
|
2017-03-05 04:49:10 -05:00
|
|
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
|
|
|
source ${thisDir}/_travis-fold.sh
|
2016-05-03 12:24:09 -04:00
|
|
|
|
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
# Run unit tests for our tools/ directory
|
|
|
|
travisFoldStart "test.unit.tools"
|
|
|
|
node ./dist/tools/tsc-watch/ tools runCmdsOnly
|
2017-01-19 19:24:47 -05:00
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
# TODO(i) could this be rolled into the tools tests above? why is it separate?
|
|
|
|
travisFoldStart "test.unit.validate-commit-message"
|
|
|
|
(
|
|
|
|
cd tools/validate-commit-message
|
|
|
|
$(npm bin)/jasmine
|
|
|
|
)
|
|
|
|
travisFoldEnd "test.unit.validate-commit-message"
|
|
|
|
travisFoldEnd "test.unit.tools"
|
2016-05-03 12:24:09 -04:00
|
|
|
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
# Run unit tests in node
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "test.unit.node"
|
|
|
|
node ./dist/tools/tsc-watch/ node runCmdsOnly
|
|
|
|
travisFoldEnd "test.unit.node"
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
|
2016-06-15 09:58:57 -04:00
|
|
|
# rebuild to revert files in @angular/compiler/test
|
|
|
|
# TODO(tbosch): remove this and teach karma to serve the right files
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "test.unit.rebuildHack"
|
2017-03-07 14:04:30 -05:00
|
|
|
node dist/tools/@angular/tsc-wrapped/src/main -p packages/tsconfig.json
|
2017-03-08 18:53:45 -05:00
|
|
|
node dist/tools/@angular/tsc-wrapped/src/main -p modules/tsconfig.json
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "test.unit.rebuildHack"
|
|
|
|
|
2016-05-03 12:24:09 -04:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
if [[ ${TRAVIS} ]]; then
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "test.unit.xvfb-start"
|
|
|
|
sh -e /etc/init.d/xvfb start
|
|
|
|
travisFoldEnd "test.unit.xvfb-start"
|
2016-04-28 20:50:03 -04:00
|
|
|
fi
|
|
|
|
|
2016-06-21 13:35:42 -04:00
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "test.unit.localChrome"
|
|
|
|
$(npm bin)/karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
|
|
|
travisFoldEnd "test.unit.localChrome"
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "test.unit.localChrome.router"
|
2017-03-07 14:04:30 -05:00
|
|
|
$(npm bin)/karma start ./packages/router/karma.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldEnd "test.unit.localChrome.router"
|