angular-docs-cn/scripts/ci/test-aio.sh

38 lines
732 B
Bash
Raw Normal View History

2017-01-25 12:39:01 -05:00
#!/usr/bin/env bash
set -u -e -o pipefail
2017-01-25 12:39:01 -05:00
# Setup environment
readonly thisDir=$(cd $(dirname $0); pwd)
source ${thisDir}/_travis-fold.sh
# run in subshell to avoid polluting cwd
(
cd ${PROJECT_ROOT}/aio
# Lint the code
travisFoldStart "test.aio.lint"
yarn run lint
travisFoldEnd "test.aio.lint"
# Start xvfb for local Chrome used for testing
if [[ ${TRAVIS} ]]; then
travisFoldStart "test.aio.xvfb-start"
sh -e /etc/init.d/xvfb start
travisFoldEnd "test.aio.xvfb-start"
fi
# Run unit tests
travisFoldStart "test.aio.unit"
yarn test -- --single-run
travisFoldEnd "test.aio.unit"
# Run e2e tests
travisFoldStart "test.aio.e2e"
yarn run e2e
travisFoldEnd "test.aio.e2e"
)