Skip to content

Commit f76b575

Browse files
Merge pull request #116 from angular/master
Update add-classes-with-d3.english
2 parents a0c79d6 + 3e38032 commit f76b575

File tree

12 files changed

+199
-71
lines changed

12 files changed

+199
-71
lines changed

Gruntfile.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,16 @@ module.exports = function(grunt) {
141141
'jquery-2.2': 'karma-jquery-2.2.conf.js',
142142
'jquery-2.1': 'karma-jquery-2.1.conf.js',
143143
docs: 'karma-docs.conf.js',
144-
modules: 'karma-modules.conf.js'
144+
'modules-ngAnimate': 'ngAnimate',
145+
'modules-ngAria': 'ngAria',
146+
'modules-ngCookies': 'ngCookies',
147+
'modules-ngMessageFormat': 'ngMessageFormat',
148+
'modules-ngMessages': 'ngMessages',
149+
'modules-ngMock': 'ngMock',
150+
'modules-ngResource': 'ngResource',
151+
'modules-ngRoute': 'ngRoute',
152+
'modules-ngSanitize': 'ngSanitize',
153+
'modules-ngTouch': 'ngTouch'
145154
},
146155

147156

@@ -430,7 +439,16 @@ module.exports = function(grunt) {
430439
grunt.registerTask('test:jquery-2.1', 'Run the jQuery 2.1 unit tests with Karma', ['tests:jquery-2.1']);
431440
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', [
432441
'build',
433-
'tests:modules'
442+
'tests:modules-ngAnimate',
443+
'tests:modules-ngAria',
444+
'tests:modules-ngCookies',
445+
'tests:modules-ngMessageFormat',
446+
'tests:modules-ngMessages',
447+
'tests:modules-ngMock',
448+
'tests:modules-ngResource',
449+
'tests:modules-ngRoute',
450+
'tests:modules-ngSanitize',
451+
'tests:modules-ngTouch'
434452
]);
435453
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
436454
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', [

angularFiles.js

Lines changed: 86 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,84 @@ var angularFiles = {
189189
'src/angular.bind.js'
190190
],
191191

192-
'karmaModules': [
192+
'karmaModulesBase': [
193193
'build/angular.js',
194-
'@angularSrcModules',
194+
'build/angular-mocks.js',
195195
'test/modules/no_bootstrap.js',
196-
'test/helpers/*.js',
197-
'test/ngAnimate/*.js',
198-
'test/ngMessageFormat/*.js',
199-
'test/ngMessages/*.js',
200-
'test/ngMock/*.js',
201-
'test/ngCookies/*.js',
202-
'test/ngRoute/**/*.js',
203-
'test/ngResource/*.js',
204-
'test/ngSanitize/**/*.js',
205-
'test/ngTouch/**/*.js',
206-
'test/ngAria/*.js'
196+
'test/helpers/matchers.js',
197+
'test/helpers/privateMocks.js',
198+
'test/helpers/support.js',
199+
'test/helpers/testabilityPatch.js'
200+
],
201+
202+
'karmaModules-ngAnimate': [
203+
'@karmaModulesBase',
204+
'@angularSrcModuleNgAnimate',
205+
'test/ngAnimate/**/*.js'
206+
],
207+
208+
'karmaModules-ngAria': [
209+
'@karmaModulesBase',
210+
'@angularSrcModuleNgAria',
211+
'test/ngAria/**/*.js'
212+
],
213+
214+
'karmaModules-ngCookies': [
215+
'@karmaModulesBase',
216+
'@angularSrcModuleNgCookies',
217+
'test/ngCookies/**/*.js'
218+
],
219+
220+
'karmaModules-ngMessageFormat': [
221+
'@karmaModulesBase',
222+
'@angularSrcModuleNgMessageFormat',
223+
'test/ngMessageFormat/**/*.js'
224+
],
225+
226+
'karmaModules-ngMessages': [
227+
'@karmaModulesBase',
228+
'build/angular-animate.js',
229+
'@angularSrcModuleNgMessages',
230+
'test/ngMessages/**/*.js'
231+
],
232+
233+
// ngMock doesn't include the base because it must use the ngMock src files
234+
'karmaModules-ngMock': [
235+
'build/angular.js',
236+
'src/ngMock/*.js',
237+
'test/modules/no_bootstrap.js',
238+
'test/helpers/matchers.js',
239+
'test/helpers/privateMocks.js',
240+
'test/helpers/support.js',
241+
'test/helpers/testabilityPatch.js',
242+
'src/routeToRegExp.js',
243+
'build/angular-animate.js',
244+
'test/ngMock/**/*.js'
245+
],
246+
247+
'karmaModules-ngResource': [
248+
'@karmaModulesBase',
249+
'@angularSrcModuleNgResource',
250+
'test/ngResource/**/*.js'
251+
],
252+
253+
'karmaModules-ngRoute': [
254+
'@karmaModulesBase',
255+
'build/angular-animate.js',
256+
'@angularSrcModuleNgRoute',
257+
'test/ngRoute/**/*.js'
258+
],
259+
260+
'karmaModules-ngSanitize': [
261+
'@karmaModulesBase',
262+
'@angularSrcModuleNgSanitize',
263+
'test/ngSanitize/**/*.js'
264+
],
265+
266+
'karmaModules-ngTouch': [
267+
'@karmaModulesBase',
268+
'@angularSrcModuleNgTouch',
269+
'test/ngTouch/**/*.js'
207270
],
208271

209272
'karmaJquery': [
@@ -232,6 +295,16 @@ var angularFiles = {
232295
});
233296
});
234297

298+
angularFiles['angularSrcModuleNgAnimate'] = angularFiles['angularModules']['ngAnimate'];
299+
angularFiles['angularSrcModuleNgAria'] = angularFiles['angularModules']['ngAria'];
300+
angularFiles['angularSrcModuleNgCookies'] = angularFiles['angularModules']['ngCookies'];
301+
angularFiles['angularSrcModuleNgMessageFormat'] = angularFiles['angularModules']['ngMessageFormat'];
302+
angularFiles['angularSrcModuleNgMessages'] = angularFiles['angularModules']['ngMessages'];
303+
angularFiles['angularSrcModuleNgResource'] = angularFiles['angularModules']['ngResource'];
304+
angularFiles['angularSrcModuleNgRoute'] = angularFiles['angularModules']['ngRoute'];
305+
angularFiles['angularSrcModuleNgSanitize'] = angularFiles['angularModules']['ngSanitize'];
306+
angularFiles['angularSrcModuleNgTouch'] = angularFiles['angularModules']['ngTouch'];
307+
235308
angularFiles['angularSrcModules'] = [].concat(
236309
angularFiles['angularModules']['ngAnimate'],
237310
angularFiles['angularModules']['ngMessageFormat'],

karma-modules.conf.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ var angularFiles = require('./angularFiles');
44
var sharedConfig = require('./karma-shared.conf');
55

66
module.exports = function(config) {
7-
sharedConfig(config, {testName: 'AngularJS: modules', logFile: 'karma-modules.log'});
7+
var angularModule = process.env.KARMA_MODULE;
88

9-
config.set({
10-
files: angularFiles.mergeFilesFor('karmaModules'),
9+
sharedConfig(config, {testName: 'AngularJS: module ' + angularModule, logFile: 'karma-modules-' + angularModule + '.log'});
1110

12-
junitReporter: {
13-
outputFile: 'test_out/modules.xml',
14-
suite: 'modules'
15-
}
11+
config.set({
12+
files: angularFiles.mergeFilesFor('karmaModules-' + angularModule)
1613
});
1714
};

lib/grunt/plugins.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@ module.exports = function(grunt) {
4343

4444

4545
grunt.registerMultiTask('tests', '**Use `grunt test` instead**', function() {
46-
util.startKarma(this.data, true, this.async());
46+
var configFile;
47+
48+
if (this.nameArgs.includes('modules')) {
49+
configFile = 'karma-modules.conf.js';
50+
process.env.KARMA_MODULE = this.data;
51+
} else {
52+
configFile = this.data;
53+
}
54+
55+
util.startKarma(configFile, true, this.async());
4756
});
4857

4958

lib/saucelabs/start_tunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -e
1111
# Curl and run this script as part of your .travis.yml before_script section:
1212
# before_script:
1313
# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
14-
SC_VERSION="4.4.12"
14+
SC_VERSION="4.5.1"
1515
CONNECT_URL="https://saucelabs.com/downloads/sc-$SC_VERSION-linux.tar.gz"
1616
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
1717
CONNECT_DOWNLOAD="sc-$SC_VERSION-linux.tar.gz"

src/ngAnimate/ngAnimateSwap.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ var ngAnimateSwapDirective = ['$animate', function($animate) {
9292
restrict: 'A',
9393
transclude: 'element',
9494
terminal: true,
95-
priority: 600, // we use 600 here to ensure that the directive is caught before others
95+
priority: 550, // We use 550 here to ensure that the directive is caught before others,
96+
// but after `ngIf` (at priority 600).
9697
link: function(scope, $element, attrs, ctrl, $transclude) {
9798
var previousElement, previousScope;
9899
scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) {

src/ngMessageFormat/messageFormatService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ var noop;
215215
var toJson;
216216
var $$stringify;
217217

218-
var module = window['angular']['module']('ngMessageFormat', ['ng']);
219-
module['info']({ 'angularVersion': '"NG_VERSION_FULL"' });
220-
module['factory']('$$messageFormat', $$MessageFormatFactory);
221-
module['config'](['$provide', function($provide) {
218+
var ngModule = window['angular']['module']('ngMessageFormat', ['ng']);
219+
ngModule['info']({ 'angularVersion': '"NG_VERSION_FULL"' });
220+
ngModule['factory']('$$messageFormat', $$MessageFormatFactory);
221+
ngModule['config'](['$provide', function($provide) {
222222
$interpolateMinErr = window['angular']['$interpolateMinErr'];
223223
isFunction = window['angular']['isFunction'];
224224
noop = window['angular']['noop'];

src/ngMock/angular-mocks.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,20 +1619,20 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
16191619

16201620
/**
16211621
* @ngdoc method
1622-
* @name $httpBackend#matchLatestDefinition
1622+
* @name $httpBackend#matchLatestDefinitionEnabled
16231623
* @description
16241624
* This method can be used to change which mocked responses `$httpBackend` returns, when defining
16251625
* them with {@link ngMock.$httpBackend#when $httpBackend.when()} (and shortcut methods).
16261626
* By default, `$httpBackend` returns the first definition that matches. When setting
1627-
* `$http.matchLatestDefinition(true)`, it will use the last response that matches, i.e. the
1627+
* `$http.matchLatestDefinitionEnabled(true)`, it will use the last response that matches, i.e. the
16281628
* one that was added last.
16291629
*
16301630
* ```js
16311631
* hb.when('GET', '/url1').respond(200, 'content', {});
16321632
* hb.when('GET', '/url1').respond(201, 'another', {});
16331633
* hb('GET', '/url1'); // receives "content"
16341634
*
1635-
* $http.matchLatestDefinition(true)
1635+
* $http.matchLatestDefinitionEnabled(true)
16361636
* hb('GET', '/url1'); // receives "another"
16371637
*
16381638
* hb.when('GET', '/url1').respond(201, 'onemore', {});
@@ -1641,7 +1641,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
16411641
*
16421642
* This is useful if a you have a default response that is overriden inside specific tests.
16431643
*
1644-
* Note that different from config methods on providers, `matchLatestDefinition()` can be changed
1644+
* Note that different from config methods on providers, `matchLatestDefinitionEnabled()` can be changed
16451645
* even when the application is already running.
16461646
*
16471647
* @param {Boolean=} value value to set, either `true` or `false`. Default is `false`.
@@ -1650,7 +1650,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
16501650
* as a getter
16511651
*/
16521652
$httpBackend.matchLatestDefinitionEnabled = function(value) {
1653-
if (isDefined(value)) {
1653+
if (angular.isDefined(value)) {
16541654
matchLatestDefinition = value;
16551655
return this;
16561656
} else {
@@ -2919,21 +2919,21 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
29192919
*/
29202920
/**
29212921
* @ngdoc method
2922-
* @name $httpBackend#matchLatestDefinition
2922+
* @name $httpBackend#matchLatestDefinitionEnabled
29232923
* @module ngMockE2E
29242924
* @description
29252925
* This method can be used to change which mocked responses `$httpBackend` returns, when defining
29262926
* them with {@link ngMock.$httpBackend#when $httpBackend.when()} (and shortcut methods).
29272927
* By default, `$httpBackend` returns the first definition that matches. When setting
2928-
* `$http.matchLatestDefinition(true)`, it will use the last response that matches, i.e. the
2928+
* `$http.matchLatestDefinitionEnabled(true)`, it will use the last response that matches, i.e. the
29292929
* one that was added last.
29302930
*
29312931
* ```js
29322932
* hb.when('GET', '/url1').respond(200, 'content', {});
29332933
* hb.when('GET', '/url1').respond(201, 'another', {});
29342934
* hb('GET', '/url1'); // receives "content"
29352935
*
2936-
* $http.matchLatestDefinition(true)
2936+
* $http.matchLatestDefinitionEnabled(true)
29372937
* hb('GET', '/url1'); // receives "another"
29382938
*
29392939
* hb.when('GET', '/url1').respond(201, 'onemore', {});
@@ -2942,7 +2942,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
29422942
*
29432943
* This is useful if a you have a default response that is overriden inside specific tests.
29442944
*
2945-
* Note that different from config methods on providers, `matchLatestDefinition()` can be changed
2945+
* Note that different from config methods on providers, `matchLatestDefinitionEnabled()` can be changed
29462946
* even when the application is already running.
29472947
*
29482948
* @param {Boolean=} value value to set, either `true` or `false`. Default is `false`.

0 commit comments

Comments
 (0)