build: test against angular snapshots (#12600)

This commit is contained in:
Paul Gschwendtner
2018-08-13 15:53:03 +02:00
committed by Joey Perrott
parent 86925e203d
commit 1f9df4c907
3 changed files with 31 additions and 6 deletions
+2 -4
View File
@@ -5,7 +5,7 @@ sudo: false
node_js:
# Use the explicit NodeJS LTS version 8.9.4 to avoid any automatic upgrade of the version.
# This ensures that all Travis jobs run consistently and don't have different Node versions.
- '8.9.4'
- '8.11.3'
addons:
jwt:
@@ -39,9 +39,6 @@ jobs:
if: type = push
- env: "DEPLOY_MODE=dashboard"
if: type = cron
# Closure Compiler CI check is temporarily disabled until a new version of
# the tool is released with https://github.com/google/closure-compiler/pull/2600
# - env: "MODE=closure-compiler"
env:
global:
- LOGS_DIR=/tmp/angular-material2-build/logs
@@ -53,6 +50,7 @@ env:
before_install:
- source ./scripts/ci/travis-env.sh
- if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then ./scripts/install-angular-snapshot.sh --only-save; fi
install:
- npm install
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# Script that modifies the project `package.json` by setting the version for all Angular
# dependencies to the Github snapshot builds. Afterwards, if the `--only-save` flag is not set,
# the script will also run NPM to install the new versions.
set -e
# Go to the project root directory
cd $(dirname $0)/../
searchRegex='(@angular\/(.*))":\s+".*"'
searchReplace='\1": "github:angular\/\2-builds"'
# Replace the Angular versions in `package.json` with their corresponding
# build snapshots so that we only have to run `npm install` once.
sed -i -r "s/${searchRegex}/${searchReplace}/g" package.json
if [[ ${*} != *--only-save* ]]; then
npm install
fi
+8 -2
View File
@@ -38,11 +38,17 @@ function isMaterialSpecFile(path) {
/** Configures Angular's TestBed. */
function configureTestBed() {
return Promise.all([
System.import('@angular/core'),
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
]).then(function (providers) {
var testing = providers[0];
var testingBrowser = providers[1];
var core = providers[0];
var testing = providers[1];
var testingBrowser = providers[2];
console.log('----------');
console.log('Running tests using Angular version: ' + core.VERSION.full);
console.log('----------');
var testBed = testing.TestBed.initTestEnvironment(
testingBrowser.BrowserDynamicTestingModule,