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 | 52 | ||||
-rw-r--r-- | js/vendor/angular-mocks/bower.json | 4 | ||||
-rw-r--r-- | js/vendor/angular-mocks/package.json | 27 |
4 files changed, 69 insertions, 24 deletions
diff --git a/js/vendor/angular-mocks/.bower.json b/js/vendor/angular-mocks/.bower.json index b8f52aad9..e5c2af823 100644 --- a/js/vendor/angular-mocks/.bower.json +++ b/js/vendor/angular-mocks/.bower.json @@ -1,16 +1,16 @@ { "name": "angular-mocks", - "version": "1.3.0-rc.4", + "version": "1.3.0", "main": "./angular-mocks.js", "dependencies": { - "angular": "1.3.0-rc.4" + "angular": "1.3.0" }, "homepage": "https://github.com/angular/bower-angular-mocks", - "_release": "1.3.0-rc.4", + "_release": "1.3.0", "_resolution": { "type": "version", - "tag": "v1.3.0-rc.4", - "commit": "5f883d4621cafeed13a671daf295ec8df7f5a315" + "tag": "v1.3.0", + "commit": "4c8d621ebb66ccb90563767d3f4282e9682a84b7" }, "_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 fee32da0d..ecbb22bcf 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.0-rc.4 + * @license AngularJS v1.3.0 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -53,9 +53,10 @@ angular.mock.$Browser = function() { self.onUrlChange = function(listener) { self.pollFns.push( function() { - if (self.$$lastUrl != self.$$url) { + if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) { self.$$lastUrl = self.$$url; - listener(self.$$url); + self.$$lastState = self.$$state; + listener(self.$$url, self.$$state); } } ); @@ -151,15 +152,24 @@ angular.mock.$Browser.prototype = { return pollFn; }, - url: function(url, replace) { + url: function(url, replace, state) { + if (angular.isUndefined(state)) { + state = null; + } if (url) { this.$$url = url; + // Native pushState serializes & copies the object; simulate it. + this.$$state = angular.copy(state); return this; } return this.$$url; }, + state: function() { + return this.$$state; + }, + cookies: function(name, value) { if (name) { if (angular.isUndefined(value)) { @@ -191,7 +201,7 @@ angular.mock.$Browser.prototype = { * * @description * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors - * passed into the `$exceptionHandler`. + * passed to the `$exceptionHandler`. */ /** @@ -200,7 +210,7 @@ angular.mock.$Browser.prototype = { * * @description * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed - * into it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration + * to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration * information. * * @@ -240,9 +250,8 @@ angular.mock.$ExceptionHandlerProvider = function() { * * @param {string} mode Mode of operation, defaults to `rethrow`. * - * - `rethrow`: If any errors are passed into the handler in tests, it typically - * means that there is a bug in the application or test, so this mock will - * make these tests fail. + * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there + * is a bug in the application or test, so this mock will make these tests fail. * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` * mode stores an array of errors in `$exceptionHandler.errors`, to allow later * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and @@ -333,7 +342,7 @@ angular.mock.$LogProvider = function() { * @name $log#log.logs * * @description - * Array of messages logged using {@link ngMock.$log#log}. + * Array of messages logged using {@link ng.$log#log `log()`}. * * @example * ```js @@ -347,7 +356,7 @@ angular.mock.$LogProvider = function() { * @name $log#info.logs * * @description - * Array of messages logged using {@link ngMock.$log#info}. + * Array of messages logged using {@link ng.$log#info `info()`}. * * @example * ```js @@ -361,7 +370,7 @@ angular.mock.$LogProvider = function() { * @name $log#warn.logs * * @description - * Array of messages logged using {@link ngMock.$log#warn}. + * Array of messages logged using {@link ng.$log#warn `warn()`}. * * @example * ```js @@ -375,7 +384,7 @@ angular.mock.$LogProvider = function() { * @name $log#error.logs * * @description - * Array of messages logged using {@link ngMock.$log#error}. + * Array of messages logged using {@link ng.$log#error `error()`}. * * @example * ```js @@ -389,7 +398,7 @@ angular.mock.$LogProvider = function() { * @name $log#debug.logs * * @description - * Array of messages logged using {@link ngMock.$log#debug}. + * Array of messages logged using {@link ng.$log#debug `debug()`}. * * @example * ```js @@ -405,8 +414,8 @@ angular.mock.$LogProvider = function() { * @name $log#assertEmpty * * @description - * Assert that the all of the logging methods have no logged messages. If messages present, an - * exception is thrown. + * Assert that all of the logging methods have no logged messages. If any messages are present, + * an exception is thrown. */ $log.assertEmpty = function() { var errors = []; @@ -801,11 +810,12 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng']) }; angular.forEach( - ['enter','leave','move','addClass','removeClass','setClass'], function(method) { + ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) { animate[method] = function() { animate.queue.push({ event : method, element : arguments[0], + options : arguments[arguments.length-1], args : arguments }); return $delegate[method].apply($delegate, arguments); @@ -991,6 +1001,11 @@ angular.mock.dump = function(object) { * First we create the controller under test: * ```js + // The module code + angular + .module('MyApp', []) + .controller('MyController', MyController); + // The controller code function MyController($scope, $http) { var authToken; @@ -1020,6 +1035,9 @@ angular.mock.dump = function(object) { describe('MyController', function() { var $httpBackend, $rootScope, createController, authRequestHandler; + // Set up the module + beforeEach(module('MyApp')); + beforeEach(inject(function($injector) { // Set up the mock http service responses $httpBackend = $injector.get('$httpBackend'); diff --git a/js/vendor/angular-mocks/bower.json b/js/vendor/angular-mocks/bower.json index a3464f253..08e043632 100644 --- a/js/vendor/angular-mocks/bower.json +++ b/js/vendor/angular-mocks/bower.json @@ -1,8 +1,8 @@ { "name": "angular-mocks", - "version": "1.3.0-rc.4", + "version": "1.3.0", "main": "./angular-mocks.js", "dependencies": { - "angular": "1.3.0-rc.4" + "angular": "1.3.0" } } diff --git a/js/vendor/angular-mocks/package.json b/js/vendor/angular-mocks/package.json new file mode 100644 index 000000000..3f690e731 --- /dev/null +++ b/js/vendor/angular-mocks/package.json @@ -0,0 +1,27 @@ +{ + "name": "angular-mocks", + "version": "1.3.0", + "description": "AngularJS mocks for testing", + "main": "angular-mocks.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/angular/angular.js.git" + }, + "keywords": [ + "angular", + "framework", + "browser", + "mocks", + "testing", + "client-side" + ], + "author": "Angular Core Team <angular-core+npm@google.com>", + "license": "MIT", + "bugs": { + "url": "https://github.com/angular/angular.js/issues" + }, + "homepage": "http://angularjs.org" +} |