Skip to content
This repository was archived by the owner on Mar 31, 2019. It is now read-only.

Commit ac00ed4

Browse files
author
Hidekazu Kobayashi
committed
Merge remote-tracking branch 'source/master'
2 parents 221f144 + db12c85 commit ac00ed4

18 files changed

+3132
-1214
lines changed

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = function (grunt) {
9595
configFile: 'config/karma-1.1.5.js'
9696
},
9797
future: {
98-
configFile: 'config/karma-1.3.0-rc.1.js'
98+
configFile: 'config/karma-1.3.0.js'
9999
},
100100
background: {
101101
background: true,

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Check out the sample app: http://angular-ui.github.io/ui-router/sample/
3131

3232
## Get Started
3333

34-
**(1)** Get UI-Router in one of 4 ways:
35-
- clone & [build](#developing) this repository
34+
**(1)** Get UI-Router in one of the following ways:
35+
- clone & [build](CONTRIBUTING.md#developing) this repository
3636
- [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js))
3737
- via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console
3838
- or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console

config/karma-1.3.0-rc.1.js renamed to config/karma-1.3.0.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function (karma) {
88
basePath: '..',
99

1010
// list of files / patterns to load in the browser
11-
files: [].concat(files.angular('1.3.0-rc.1'), files.testUtils, files.src, files.test),
11+
files: [].concat(files.angular('1.3.0'), files.testUtils, files.src, files.test),
1212

1313
// level of logging
1414
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG

files.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ routerFiles = {
2323
return [
2424
'lib/angular-' + version + '/angular.js',
2525
'lib/angular-' + version + '/angular-mocks.js'
26-
].concat(['1.2.14', '1.3.0-rc.1'].indexOf(version) !== -1 ? ['lib/angular-' + version + '/angular-animate.js'] : []);
26+
].concat(['1.2.14', '1.3.0'].indexOf(version) !== -1 ? ['lib/angular-' + version + '/angular-animate.js'] : []);
2727
}
2828
};
2929

lib/angular-1.3.0-rc.1/angular-animate.js renamed to lib/angular-1.3.0/angular-animate.js

+337-105
Large diffs are not rendered by default.

lib/angular-1.3.0-rc.1/angular-mocks.js renamed to lib/angular-1.3.0/angular-mocks.js

+35-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.0-rc.1
2+
* @license AngularJS v1.3.0
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -53,9 +53,10 @@ angular.mock.$Browser = function() {
5353
self.onUrlChange = function(listener) {
5454
self.pollFns.push(
5555
function() {
56-
if (self.$$lastUrl != self.$$url) {
56+
if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) {
5757
self.$$lastUrl = self.$$url;
58-
listener(self.$$url);
58+
self.$$lastState = self.$$state;
59+
listener(self.$$url, self.$$state);
5960
}
6061
}
6162
);
@@ -151,15 +152,24 @@ angular.mock.$Browser.prototype = {
151152
return pollFn;
152153
},
153154

154-
url: function(url, replace) {
155+
url: function(url, replace, state) {
156+
if (angular.isUndefined(state)) {
157+
state = null;
158+
}
155159
if (url) {
156160
this.$$url = url;
161+
// Native pushState serializes & copies the object; simulate it.
162+
this.$$state = angular.copy(state);
157163
return this;
158164
}
159165

160166
return this.$$url;
161167
},
162168

169+
state: function() {
170+
return this.$$state;
171+
},
172+
163173
cookies: function(name, value) {
164174
if (name) {
165175
if (angular.isUndefined(value)) {
@@ -191,7 +201,7 @@ angular.mock.$Browser.prototype = {
191201
*
192202
* @description
193203
* Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors
194-
* passed into the `$exceptionHandler`.
204+
* passed to the `$exceptionHandler`.
195205
*/
196206

197207
/**
@@ -200,7 +210,7 @@ angular.mock.$Browser.prototype = {
200210
*
201211
* @description
202212
* Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed
203-
* into it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration
213+
* to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration
204214
* information.
205215
*
206216
*
@@ -240,9 +250,8 @@ angular.mock.$ExceptionHandlerProvider = function() {
240250
*
241251
* @param {string} mode Mode of operation, defaults to `rethrow`.
242252
*
243-
* - `rethrow`: If any errors are passed into the handler in tests, it typically
244-
* means that there is a bug in the application or test, so this mock will
245-
* make these tests fail.
253+
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
254+
* is a bug in the application or test, so this mock will make these tests fail.
246255
* - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
247256
* mode stores an array of errors in `$exceptionHandler.errors`, to allow later
248257
* assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
@@ -333,7 +342,7 @@ angular.mock.$LogProvider = function() {
333342
* @name $log#log.logs
334343
*
335344
* @description
336-
* Array of messages logged using {@link ngMock.$log#log}.
345+
* Array of messages logged using {@link ng.$log#log `log()`}.
337346
*
338347
* @example
339348
* ```js
@@ -347,7 +356,7 @@ angular.mock.$LogProvider = function() {
347356
* @name $log#info.logs
348357
*
349358
* @description
350-
* Array of messages logged using {@link ngMock.$log#info}.
359+
* Array of messages logged using {@link ng.$log#info `info()`}.
351360
*
352361
* @example
353362
* ```js
@@ -361,7 +370,7 @@ angular.mock.$LogProvider = function() {
361370
* @name $log#warn.logs
362371
*
363372
* @description
364-
* Array of messages logged using {@link ngMock.$log#warn}.
373+
* Array of messages logged using {@link ng.$log#warn `warn()`}.
365374
*
366375
* @example
367376
* ```js
@@ -375,7 +384,7 @@ angular.mock.$LogProvider = function() {
375384
* @name $log#error.logs
376385
*
377386
* @description
378-
* Array of messages logged using {@link ngMock.$log#error}.
387+
* Array of messages logged using {@link ng.$log#error `error()`}.
379388
*
380389
* @example
381390
* ```js
@@ -389,7 +398,7 @@ angular.mock.$LogProvider = function() {
389398
* @name $log#debug.logs
390399
*
391400
* @description
392-
* Array of messages logged using {@link ngMock.$log#debug}.
401+
* Array of messages logged using {@link ng.$log#debug `debug()`}.
393402
*
394403
* @example
395404
* ```js
@@ -405,8 +414,8 @@ angular.mock.$LogProvider = function() {
405414
* @name $log#assertEmpty
406415
*
407416
* @description
408-
* Assert that the all of the logging methods have no logged messages. If messages present, an
409-
* exception is thrown.
417+
* Assert that all of the logging methods have no logged messages. If any messages are present,
418+
* an exception is thrown.
410419
*/
411420
$log.assertEmpty = function() {
412421
var errors = [];
@@ -801,11 +810,12 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
801810
};
802811

803812
angular.forEach(
804-
['enter','leave','move','addClass','removeClass','setClass'], function(method) {
813+
['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) {
805814
animate[method] = function() {
806815
animate.queue.push({
807816
event : method,
808817
element : arguments[0],
818+
options : arguments[arguments.length-1],
809819
args : arguments
810820
});
811821
return $delegate[method].apply($delegate, arguments);
@@ -991,6 +1001,11 @@ angular.mock.dump = function(object) {
9911001
* First we create the controller under test:
9921002
*
9931003
```js
1004+
// The module code
1005+
angular
1006+
.module('MyApp', [])
1007+
.controller('MyController', MyController);
1008+
9941009
// The controller code
9951010
function MyController($scope, $http) {
9961011
var authToken;
@@ -1020,6 +1035,9 @@ angular.mock.dump = function(object) {
10201035
describe('MyController', function() {
10211036
var $httpBackend, $rootScope, createController, authRequestHandler;
10221037
1038+
// Set up the module
1039+
beforeEach(module('MyApp'));
1040+
10231041
beforeEach(inject(function($injector) {
10241042
// Set up the mock http service responses
10251043
$httpBackend = $injector.get('$httpBackend');

0 commit comments

Comments
 (0)