chore(dep): update internal batarang angular.js to v1.0.6

test-unit-sauce
Brian Ford 11 years ago
parent 2da618fdd7
commit 898fe826ba

@ -1,6 +1,5 @@
/** /**
* @license AngularJS v"NG_VERSION_FULL" * @license AngularJS v1.0.6
* (c) 2010-2012 Google, Inc. http://angularjs.org * (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
* *
@ -203,6 +202,30 @@ angular.mock.$Browser.prototype = {
* Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed
* into it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration * into it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration
* information. * information.
*
*
* <pre>
* describe('$exceptionHandlerProvider', function() {
*
* it('should capture log messages and exceptions', function() {
*
* module(function($exceptionHandlerProvider) {
* $exceptionHandlerProvider.mode('log');
* });
*
* inject(function($log, $exceptionHandler, $timeout) {
* $timeout(function() { $log.log(1); });
* $timeout(function() { $log.log(2); throw 'banana peel'; });
* $timeout(function() { $log.log(3); });
* expect($exceptionHandler.errors).toEqual([]);
* expect($log.assertEmpty());
* $timeout.flush();
* expect($exceptionHandler.errors).toEqual(['banana peel']);
* expect($log.log.logs).toEqual([[1], [2], [3]]);
* });
* });
* });
* </pre>
*/ */
angular.mock.$ExceptionHandlerProvider = function() { angular.mock.$ExceptionHandlerProvider = function() {
@ -221,8 +244,8 @@ angular.mock.$ExceptionHandlerProvider = function() {
* - `rethrow`: If any errors are are passed into the handler in tests, it typically * - `rethrow`: If any errors are are passed into the handler in tests, it typically
* means that there is a bug in the application or test, so this mock will * means that there is a bug in the application or test, so this mock will
* make these tests fail. * make these tests fail.
* - `log`: Sometimes it is desirable to test that an error is throw, for this case the `log` mode stores the * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` mode stores an
* error and allows later assertion of it. * array of errors in `$exceptionHandler.errors`, to allow later assertion of them.
* See {@link ngMock.$log#assertEmpty assertEmpty()} and * See {@link ngMock.$log#assertEmpty assertEmpty()} and
* {@link ngMock.$log#reset reset()} * {@link ngMock.$log#reset reset()}
*/ */
@ -407,7 +430,7 @@ angular.mock.$LogProvider = function() {
* *
* *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`. * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.
* *
* Mock of the Date type which has its timezone specified via constroctor arg. * Mock of the Date type which has its timezone specified via constructor arg.
* *
* The main purpose is to create Date-like instances with timezone fixed to the specified timezone * The main purpose is to create Date-like instances with timezone fixed to the specified timezone
* offset, so that we can test code that depends on local timezone settings without dependency on * offset, so that we can test code that depends on local timezone settings without dependency on
@ -562,7 +585,7 @@ angular.mock.$LogProvider = function() {
/** /**
* @ngdoc function * @ngdoc function
* @name angular.mock.debug * @name angular.mock.dump
* @description * @description
* *
* *NOTE*: this is not an injectable instance, just a globally available function. * *NOTE*: this is not an injectable instance, just a globally available function.
@ -745,7 +768,7 @@ angular.mock.dump = function(object) {
} }
// testing controller // testing controller
var $http; var $httpBackend;
beforeEach(inject(function($injector) { beforeEach(inject(function($injector) {
$httpBackend = $injector.get('$httpBackend'); $httpBackend = $injector.get('$httpBackend');
@ -1591,9 +1614,29 @@ window.jasmine && (function(window) {
afterEach(function() { afterEach(function() {
var spec = getCurrentSpec(); var spec = getCurrentSpec();
var injector = spec.$injector;
spec.$injector = null; spec.$injector = null;
spec.$modules = null; spec.$modules = null;
if (injector) {
injector.get('$rootElement').unbind();
injector.get('$browser').pollFns.length = 0;
}
angular.mock.clearDataCache(); angular.mock.clearDataCache();
// clean up jquery's fragment cache
angular.forEach(angular.element.fragments, function(val, key) {
delete angular.element.fragments[key];
});
MockXhr.$$lastInstance = null;
angular.forEach(angular.callbacks, function(val, key) {
delete angular.callbacks[key];
});
angular.callbacks.counter = 0;
}); });
function getCurrentSpec() { function getCurrentSpec() {
@ -1610,7 +1653,7 @@ window.jasmine && (function(window) {
* @name angular.mock.module * @name angular.mock.module
* @description * @description
* *
* *NOTE*: This is function is also published on window for easy access.<br> * *NOTE*: This function is also published on window for easy access.<br>
* *NOTE*: Only available with {@link http://pivotal.github.com/jasmine/ jasmine}. * *NOTE*: Only available with {@link http://pivotal.github.com/jasmine/ jasmine}.
* *
* This function registers a module configuration code. It collects the configuration information * This function registers a module configuration code. It collects the configuration information
@ -1644,8 +1687,12 @@ window.jasmine && (function(window) {
* @name angular.mock.inject * @name angular.mock.inject
* @description * @description
* *
<<<<<<< HEAD
* *NOTE*: This is function is also published on window for easy access.<br> * *NOTE*: This is function is also published on window for easy access.<br>
* *NOTE*: Only available with {@link http://pivotal.github.com/jasmine/ jasmine}. * *NOTE*: Only available with {@link http://pivotal.github.com/jasmine/ jasmine}.
=======
* *NOTE*: This function is also published on window for easy access.<br>
>>>>>>> 8dca056... docs(mocks): fix typos
* *
* The inject function wraps a function into an injectable function. The inject() creates new * The inject function wraps a function into an injectable function. The inject() creates new
* instance of {@link AUTO.$injector $injector} per test, which is then used for * instance of {@link AUTO.$injector $injector} per test, which is then used for
@ -1694,7 +1741,7 @@ window.jasmine && (function(window) {
*/ */
window.inject = angular.mock.inject = function() { window.inject = angular.mock.inject = function() {
var blockFns = Array.prototype.slice.call(arguments, 0); var blockFns = Array.prototype.slice.call(arguments, 0);
var stack = new Error('Declaration Location').stack; var errorForStack = new Error('Declaration Location');
return isSpecRunning() ? workFn() : workFn; return isSpecRunning() ? workFn() : workFn;
///////////////////// /////////////////////
function workFn() { function workFn() {
@ -1710,10 +1757,12 @@ window.jasmine && (function(window) {
try { try {
injector.invoke(blockFns[i] || angular.noop, this); injector.invoke(blockFns[i] || angular.noop, this);
} catch (e) { } catch (e) {
if(e.stack) e.stack += '\n' + stack; if(e.stack && errorForStack) e.stack += '\n' + errorForStack.stack;
throw e; throw e;
} finally {
errorForStack = null;
} }
} }
} }
} };
})(window); })(window);

1453
js/lib/angular.js vendored

File diff suppressed because it is too large Load Diff