2019-01-14 20:47:39 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -u -e -o pipefail
|
|
|
|
|
|
|
|
# This script runs unit tests from angular/material2.
|
|
|
|
|
|
|
|
# Save the dir for the root of the Angular repo.
|
|
|
|
angular_dir=$(pwd)
|
|
|
|
|
2019-03-18 14:25:19 -04:00
|
|
|
# Switch into Material directory.
|
|
|
|
cd ${MATERIAL_REPO_TMP_DIR}
|
2019-01-14 20:47:39 -05:00
|
|
|
|
|
|
|
# Install this version of Angular into the freshly cloned repo.
|
2019-03-18 14:25:19 -04:00
|
|
|
rm -rf ./node_modules/@angular/*
|
|
|
|
cp -r ${angular_dir}/dist/packages-dist-ivy-aot/* ./node_modules/@angular/
|
2019-01-14 20:47:39 -05:00
|
|
|
|
2019-03-18 14:25:19 -04:00
|
|
|
# The angular/material2 CI sets TEST_PLATFORM to either "local", "saucelabs", or "browserstack".
|
|
|
|
# For angular/angular, we only want to run the "local" tests.
|
2019-01-14 20:47:39 -05:00
|
|
|
export TEST_PLATFORM=local
|
|
|
|
|
2019-02-05 13:48:18 -05:00
|
|
|
# Append the test blocklist into angular/material2's karma-test-shim.js.
|
2019-01-14 20:47:39 -05:00
|
|
|
# This filters out known-failing tests because the goal is to prevent regressions.
|
2019-03-18 14:25:19 -04:00
|
|
|
cat ${angular_dir}/tools/material-ci/angular_material_test_blocklist.js >> ./test/karma-test-shim.js
|
2019-01-14 20:47:39 -05:00
|
|
|
|
|
|
|
# Now actually run the tests.
|
|
|
|
yarn gulp test:single-run
|