summaryrefslogtreecommitdiffstats
path: root/js/vendor/angular-mocks
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-06 08:54:46 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-06 09:02:26 +0100
commit0a97b588d0fbb677614961a7b77aed77aa160014 (patch)
treecfe00eda29709ed8d19a8daf338782ba69abc073 /js/vendor/angular-mocks
parent2c4cc6ce0bd25efab0fc4cf57e3e7ee358569761 (diff)
update dev deps and angular
Diffstat (limited to 'js/vendor/angular-mocks')
-rw-r--r--js/vendor/angular-mocks/.bower.json11
-rw-r--r--js/vendor/angular-mocks/README.md23
-rw-r--r--js/vendor/angular-mocks/angular-mocks.js66
-rw-r--r--js/vendor/angular-mocks/bower.json5
-rw-r--r--js/vendor/angular-mocks/package.json2
5 files changed, 63 insertions, 44 deletions
diff --git a/js/vendor/angular-mocks/.bower.json b/js/vendor/angular-mocks/.bower.json
index e5c2af823..492732614 100644
--- a/js/vendor/angular-mocks/.bower.json
+++ b/js/vendor/angular-mocks/.bower.json
@@ -1,16 +1,17 @@
{
"name": "angular-mocks",
- "version": "1.3.0",
+ "version": "1.3.1",
"main": "./angular-mocks.js",
+ "ignore": [],
"dependencies": {
- "angular": "1.3.0"
+ "angular": "1.3.1"
},
"homepage": "https://github.com/angular/bower-angular-mocks",
- "_release": "1.3.0",
+ "_release": "1.3.1",
"_resolution": {
"type": "version",
- "tag": "v1.3.0",
- "commit": "4c8d621ebb66ccb90563767d3f4282e9682a84b7"
+ "tag": "v1.3.1",
+ "commit": "301be5a5de82a83b5c436b9a2905a99b025a7890"
},
"_source": "git://github.com/angular/bower-angular-mocks.git",
"_target": "~1.3.*",
diff --git a/js/vendor/angular-mocks/README.md b/js/vendor/angular-mocks/README.md
index 3448d2849..1604ef880 100644
--- a/js/vendor/angular-mocks/README.md
+++ b/js/vendor/angular-mocks/README.md
@@ -1,21 +1,36 @@
-# bower-angular-mocks
+# packaged angular-mocks
-This repo is for distribution on `bower`. The source for this module is in the
+This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngMock).
Please file issues and pull requests against that repo.
## Install
-Install with `bower`:
+You can install this package either with `npm` or with `bower`.
+
+### npm
+
+```shell
+npm install angular-mocks
+```
+
+The mocks are then available at `node_modules/angular-mocks/angular-mocks.js`.
+
+Note that this package is not in CommonJS format, so doing `require('angular-mocks')` will
+return `undefined`.
+
+### bower
```shell
bower install angular-mocks
```
+The mocks are then available at `bower_components/angular-mocks/angular-mocks.js`.
+
## Documentation
Documentation is available on the
-[AngularJS docs site](http://docs.angularjs.org/guide/dev_guide.unit-testing).
+[AngularJS docs site](https://docs.angularjs.org/guide/unit-testing).
## License
diff --git a/js/vendor/angular-mocks/angular-mocks.js b/js/vendor/angular-mocks/angular-mocks.js
index ecbb22bcf..2f5cb5f9b 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
+ * @license AngularJS v1.3.1
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@@ -74,7 +74,7 @@ angular.mock.$Browser = function() {
self.defer = function(fn, delay) {
delay = delay || 0;
self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});
- self.deferredFns.sort(function(a,b){ return a.time - b.time;});
+ self.deferredFns.sort(function(a, b) { return a.time - b.time;});
return self.deferredNextId++;
};
@@ -142,7 +142,7 @@ angular.mock.$Browser.prototype = {
* run all fns in pollFns
*/
poll: function poll() {
- angular.forEach(this.pollFns, function(pollFn){
+ angular.forEach(this.pollFns, function(pollFn) {
pollFn();
});
},
@@ -258,7 +258,7 @@ angular.mock.$ExceptionHandlerProvider = function() {
* {@link ngMock.$log#reset reset()}
*/
this.mode = function(mode) {
- switch(mode) {
+ switch (mode) {
case 'rethrow':
handler = function(e) {
throw e;
@@ -316,7 +316,7 @@ angular.mock.$LogProvider = function() {
}
};
- this.$get = function () {
+ this.$get = function() {
var $log = {
log: function() { $log.log.logs.push(concat([], arguments, 0)); },
warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
@@ -336,7 +336,7 @@ angular.mock.$LogProvider = function() {
* @description
* Reset all of the logging arrays to empty.
*/
- $log.reset = function () {
+ $log.reset = function() {
/**
* @ngdoc property
* @name $log#log.logs
@@ -421,7 +421,7 @@ angular.mock.$LogProvider = function() {
var errors = [];
angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {
angular.forEach($log[logLevel].logs, function(log) {
- angular.forEach(log, function (logItem) {
+ angular.forEach(log, function(logItem) {
errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' +
(logItem.stack || ''));
});
@@ -504,7 +504,7 @@ angular.mock.$IntervalProvider = function() {
id: nextRepeatId,
deferred: deferred
});
- repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
+ repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
nextRepeatId++;
return promise;
@@ -520,7 +520,7 @@ angular.mock.$IntervalProvider = function() {
* @returns {boolean} Returns `true` if the task was successfully cancelled.
*/
$interval.cancel = function(promise) {
- if(!promise) return false;
+ if (!promise) return false;
var fnIndex;
angular.forEach(repeatFns, function(fn, index) {
@@ -553,7 +553,7 @@ angular.mock.$IntervalProvider = function() {
var task = repeatFns[0];
task.fn();
task.nextTime += task.delay;
- repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
+ repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
}
return millis;
};
@@ -601,7 +601,7 @@ function padNumber(num, digits, trim) {
num = -num;
}
num = '' + num;
- while(num.length < digits) num = '0' + num;
+ while (num.length < digits) num = '0' + num;
if (trim)
num = num.substr(num.length - digits);
return neg + num;
@@ -645,7 +645,7 @@ function padNumber(num, digits, trim) {
* ```
*
*/
-angular.mock.TzDate = function (offset, timestamp) {
+angular.mock.TzDate = function(offset, timestamp) {
var self = new Date(0);
if (angular.isString(timestamp)) {
var tsStr = timestamp;
@@ -788,20 +788,20 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
$provide.decorator('$animate', ['$delegate', '$$asyncCallback', '$timeout', '$browser',
function($delegate, $$asyncCallback, $timeout, $browser) {
var animate = {
- queue : [],
- cancel : $delegate.cancel,
- enabled : $delegate.enabled,
- triggerCallbackEvents : function() {
+ queue: [],
+ cancel: $delegate.cancel,
+ enabled: $delegate.enabled,
+ triggerCallbackEvents: function() {
$$asyncCallback.flush();
},
- triggerCallbackPromise : function() {
+ triggerCallbackPromise: function() {
$timeout.flush(0);
},
- triggerCallbacks : function() {
+ triggerCallbacks: function() {
this.triggerCallbackEvents();
this.triggerCallbackPromise();
},
- triggerReflow : function() {
+ triggerReflow: function() {
angular.forEach(reflowQueue, function(fn) {
fn();
});
@@ -813,10 +813,10 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
['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
+ event: method,
+ element: arguments[0],
+ options: arguments[arguments.length-1],
+ args: arguments
});
return $delegate[method].apply($delegate, arguments);
};
@@ -883,13 +883,13 @@ angular.mock.dump = function(object) {
function serializeScope(scope, offset) {
offset = offset || ' ';
var log = [offset + 'Scope(' + scope.$id + '): {'];
- for ( var key in scope ) {
+ for (var key in scope) {
if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) {
log.push(' ' + key + ': ' + angular.toJson(scope[key]));
}
}
var child = scope.$$childHead;
- while(child) {
+ while (child) {
log.push(serializeScope(child, offset + ' '));
child = child.$$nextSibling;
}
@@ -1386,7 +1386,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
$httpBackend.expect = function(method, url, data, headers) {
var expectation = new MockHttpExpectation(method, url, data, headers),
chain = {
- respond: function (status, data, headers, statusText) {
+ respond: function(status, data, headers, statusText) {
expectation.response = createResponse(status, data, headers, statusText);
return chain;
}
@@ -1636,7 +1636,9 @@ function MockHttpExpectation(method, url, data, headers) {
if (angular.isUndefined(data)) return true;
if (data && angular.isFunction(data.test)) return data.test(d);
if (data && angular.isFunction(data)) return data(d);
- if (data && !angular.isString(data)) return angular.equals(data, angular.fromJson(d));
+ if (data && !angular.isString(data)) {
+ return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));
+ }
return data == d;
};
@@ -1709,7 +1711,7 @@ function MockXhr() {
* that adds a "flush" and "verifyNoPendingTasks" methods.
*/
-angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function ($delegate, $browser) {
+angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) {
/**
* @ngdoc method
@@ -1763,12 +1765,12 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
rafFn.supported = $delegate.supported;
rafFn.flush = function() {
- if(queue.length === 0) {
+ if (queue.length === 0) {
throw new Error('No rAF callbacks present');
}
var length = queue.length;
- for(var i=0;i<length;i++) {
+ for (var i=0;i<length;i++) {
queue[i]();
}
@@ -2036,7 +2038,7 @@ angular.mock.e2e.$httpBackendDecorator =
['$rootScope', '$delegate', '$browser', createHttpBackendMock];
-if(window.jasmine || window.mocha) {
+if (window.jasmine || window.mocha) {
var currentSpec = null,
isSpecRunning = function() {
@@ -2244,7 +2246,7 @@ if(window.jasmine || window.mocha) {
injector = currentSpec.$injector = angular.injector(modules, strictDi);
currentSpec.$injectorStrict = strictDi;
}
- for(var i = 0, ii = blockFns.length; i < ii; i++) {
+ for (var i = 0, ii = blockFns.length; i < ii; i++) {
if (currentSpec.$injectorStrict) {
// If the injector is strict / strictDi, and the spec wants to inject using automatic
// annotation, then annotate the function here.
diff --git a/js/vendor/angular-mocks/bower.json b/js/vendor/angular-mocks/bower.json
index 08e043632..ede7b4285 100644
--- a/js/vendor/angular-mocks/bower.json
+++ b/js/vendor/angular-mocks/bower.json
@@ -1,8 +1,9 @@
{
"name": "angular-mocks",
- "version": "1.3.0",
+ "version": "1.3.1",
"main": "./angular-mocks.js",
+ "ignore": [],
"dependencies": {
- "angular": "1.3.0"
+ "angular": "1.3.1"
}
}
diff --git a/js/vendor/angular-mocks/package.json b/js/vendor/angular-mocks/package.json
index 3f690e731..29203ce03 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.0",
+ "version": "1.3.1",
"description": "AngularJS mocks for testing",
"main": "angular-mocks.js",
"scripts": {