Skip to content

Commit 1b6c4e7

Browse files
devversionmhevery
authored andcommitted
build: load angular.js minified output in upgrade tests (angular#27711)
* We should try loading Angular.JS for the upgrade tests in their minfied output. There seems to be a lot flakiness in regards to loading `AngularJS` within Travis, and the `onerror` messages aren't really too helpful. In order to reduce the payload that will be passed through the Saucelabs tunnel, we should try to load the minfied output files. PR Close angular#27711
1 parent d766ad0 commit 1b6c4e7

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

BUILD.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ filegroup(
2323
filegroup(
2424
name = "angularjs_scripts",
2525
srcs = [
26+
# We also declare the unminfied AngularJS files since these can be used for
27+
# local debugging (e.g. see: packages/upgrade/test/common/test_helpers.ts)
2628
"@ngdeps//node_modules/angular:angular.js",
29+
"@ngdeps//node_modules/angular:angular.min.js",
2730
"@ngdeps//node_modules/angular-1.5:angular.js",
31+
"@ngdeps//node_modules/angular-1.5:angular.min.js",
2832
"@ngdeps//node_modules/angular-1.6:angular.js",
33+
"@ngdeps//node_modules/angular-1.6:angular.min.js",
2934
"@ngdeps//node_modules/angular-mocks:angular-mocks.js",
3035
"@ngdeps//node_modules/angular-mocks-1.5:angular-mocks.js",
3136
"@ngdeps//node_modules/angular-mocks-1.6:angular-mocks.js",

karma-js.conf.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ module.exports = function(config) {
2929
{pattern: 'dist/all/@angular/**/*.js', included: false, watched: true},
3030

3131
// Serve AngularJS for `ngUpgrade` testing.
32-
{pattern: 'node_modules/angular-1.5/angular.js', included: false, watched: false},
32+
{pattern: 'node_modules/angular-1.5/angular?(.min).js', included: false, watched: false},
3333
{pattern: 'node_modules/angular-mocks-1.5/angular-mocks.js', included: false, watched: false},
34-
{pattern: 'node_modules/angular-1.6/angular.js', included: false, watched: false},
34+
{pattern: 'node_modules/angular-1.6/angular?(.min).js', included: false, watched: false},
3535
{pattern: 'node_modules/angular-mocks-1.6/angular-mocks.js', included: false, watched: false},
36-
{pattern: 'node_modules/angular/angular.js', included: false, watched: false},
36+
{pattern: 'node_modules/angular/angular?(.min).js', included: false, watched: false},
3737
{pattern: 'node_modules/angular-mocks/angular-mocks.js', included: false, watched: false},
3838

3939
'node_modules/core-js/client/core.js',

packages/upgrade/test/common/test_helpers.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@
77
*/
88
import {setAngularJSGlobal} from '@angular/upgrade/src/common/angular1';
99

10+
// Whether the upgrade tests should run against AngularJS minified or not. This can be
11+
// temporarily switched to "false" in order to make it easy to debug AngularJS locally.
12+
const TEST_MINIFIED = true;
13+
const ANGULARJS_FILENAME = TEST_MINIFIED ? 'angular.min.js' : 'angular.js';
1014

1115
const ng1Versions = [
1216
{
1317
label: '1.5',
14-
files: ['angular-1.5/angular.js', 'angular-mocks-1.5/angular-mocks.js'],
18+
files: [`angular-1.5/${ANGULARJS_FILENAME}`, 'angular-mocks-1.5/angular-mocks.js'],
1519
},
1620
{
1721
label: '1.6',
18-
files: ['angular-1.6/angular.js', 'angular-mocks-1.6/angular-mocks.js'],
22+
files: [`angular-1.6/${ANGULARJS_FILENAME}`, 'angular-mocks-1.6/angular-mocks.js'],
1923
},
2024
{
2125
label: '1.7',
22-
files: ['angular/angular.js', 'angular-mocks/angular-mocks.js'],
26+
files: [`angular/${ANGULARJS_FILENAME}`, 'angular-mocks/angular-mocks.js'],
2327
},
2428
];
2529

0 commit comments

Comments
 (0)