diff options
Diffstat (limited to 'js/vendor/angular-mocks')
-rw-r--r-- | js/vendor/angular-mocks/.bower.json | 10 | ||||
-rw-r--r-- | js/vendor/angular-mocks/angular-mocks.js | 89 | ||||
-rw-r--r-- | js/vendor/angular-mocks/bower.json | 4 | ||||
-rw-r--r-- | js/vendor/angular-mocks/package.json | 2 |
4 files changed, 96 insertions, 9 deletions
diff --git a/js/vendor/angular-mocks/.bower.json b/js/vendor/angular-mocks/.bower.json index 492732614..fea74760e 100644 --- a/js/vendor/angular-mocks/.bower.json +++ b/js/vendor/angular-mocks/.bower.json @@ -1,17 +1,17 @@ { "name": "angular-mocks", - "version": "1.3.1", + "version": "1.3.2", "main": "./angular-mocks.js", "ignore": [], "dependencies": { - "angular": "1.3.1" + "angular": "1.3.2" }, "homepage": "https://github.com/angular/bower-angular-mocks", - "_release": "1.3.1", + "_release": "1.3.2", "_resolution": { "type": "version", - "tag": "v1.3.1", - "commit": "301be5a5de82a83b5c436b9a2905a99b025a7890" + "tag": "v1.3.2", + "commit": "3195cfb260587620e66e2f66fb04a86542f414cf" }, "_source": "git://github.com/angular/bower-angular-mocks.git", "_target": "~1.3.*", diff --git a/js/vendor/angular-mocks/angular-mocks.js b/js/vendor/angular-mocks/angular-mocks.js index 2f5cb5f9b..25b86539f 100644 --- a/js/vendor/angular-mocks/angular-mocks.js +++ b/js/vendor/angular-mocks/angular-mocks.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.3.1 + * @license AngularJS v1.3.2 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -1830,6 +1830,7 @@ angular.module('ngMock', ['ng']).provider({ $provide.decorator('$timeout', angular.mock.$TimeoutDecorator); $provide.decorator('$$rAF', angular.mock.$RAFDecorator); $provide.decorator('$$asyncCallback', angular.mock.$AsyncCallbackDecorator); + $provide.decorator('$rootScope', angular.mock.$RootScopeDecorator); }]); /** @@ -2038,6 +2039,92 @@ angular.mock.e2e.$httpBackendDecorator = ['$rootScope', '$delegate', '$browser', createHttpBackendMock]; +/** + * @ngdoc type + * @name $rootScope.Scope + * @module ngMock + * @description + * {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These + * methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when + * `ngMock` module is loaded. + * + * In addition to all the regular `Scope` methods, the following helper methods are available: + */ +angular.mock.$RootScopeDecorator = function($delegate) { + + var $rootScopePrototype = Object.getPrototypeOf($delegate); + + $rootScopePrototype.$countChildScopes = countChildScopes; + $rootScopePrototype.$countWatchers = countWatchers; + + return $delegate; + + // ------------------------------------------------------------------------------------------ // + + /** + * @ngdoc method + * @name $rootScope.Scope#$countChildScopes + * @module ngMock + * @description + * Counts all the direct and indirect child scopes of the current scope. + * + * The current scope is excluded from the count. The count includes all isolate child scopes. + * + * @returns {number} Total number of child scopes. + */ + function countChildScopes() { + // jshint validthis: true + var count = 0; // exclude the current scope + var pendingChildHeads = [this.$$childHead]; + var currentScope; + + while (pendingChildHeads.length) { + currentScope = pendingChildHeads.shift(); + + while (currentScope) { + count += 1; + pendingChildHeads.push(currentScope.$$childHead); + currentScope = currentScope.$$nextSibling; + } + } + + return count; + } + + + /** + * @ngdoc method + * @name $rootScope.Scope#$countWatchers + * @module ngMock + * @description + * Counts all the watchers of direct and indirect child scopes of the current scope. + * + * The watchers of the current scope are included in the count and so are all the watchers of + * isolate child scopes. + * + * @returns {number} Total number of watchers. + */ + function countWatchers() { + // jshint validthis: true + var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope + var pendingChildHeads = [this.$$childHead]; + var currentScope; + + while (pendingChildHeads.length) { + currentScope = pendingChildHeads.shift(); + + while (currentScope) { + count += currentScope.$$watchers ? currentScope.$$watchers.length : 0; + pendingChildHeads.push(currentScope.$$childHead); + currentScope = currentScope.$$nextSibling; + } + } + + return count; + } +}; + + if (window.jasmine || window.mocha) { var currentSpec = null, diff --git a/js/vendor/angular-mocks/bower.json b/js/vendor/angular-mocks/bower.json index ede7b4285..b84304f8a 100644 --- a/js/vendor/angular-mocks/bower.json +++ b/js/vendor/angular-mocks/bower.json @@ -1,9 +1,9 @@ { "name": "angular-mocks", - "version": "1.3.1", + "version": "1.3.2", "main": "./angular-mocks.js", "ignore": [], "dependencies": { - "angular": "1.3.1" + "angular": "1.3.2" } } diff --git a/js/vendor/angular-mocks/package.json b/js/vendor/angular-mocks/package.json index 29203ce03..17907a765 100644 --- a/js/vendor/angular-mocks/package.json +++ b/js/vendor/angular-mocks/package.json @@ -1,6 +1,6 @@ { "name": "angular-mocks", - "version": "1.3.1", + "version": "1.3.2", "description": "AngularJS mocks for testing", "main": "angular-mocks.js", "scripts": { |