mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
committed by
Peter Bacon Darwin
parent
8b921617e9
commit
31ec9f14ef
@@ -160,7 +160,7 @@ describe('Filter: filter', function() {
|
||||
{key: 1, nonkey:14}
|
||||
];
|
||||
var expr = {key: 10};
|
||||
var comparator = function (obj,value) {
|
||||
var comparator = function (obj, value) {
|
||||
return obj > value;
|
||||
};
|
||||
expect(filter(items, expr, comparator)).toEqual([items[2]]);
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('$interval', function() {
|
||||
fn: fn,
|
||||
id: nextRepeatId
|
||||
});
|
||||
repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
|
||||
repeatFns.sort(function(a, b){ return a.nextTime - b.nextTime;});
|
||||
|
||||
return nextRepeatId++;
|
||||
},
|
||||
@@ -43,7 +43,7 @@ describe('$interval', 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;
|
||||
}
|
||||
|
||||
@@ -463,12 +463,12 @@ describe('parser', function() {
|
||||
});
|
||||
|
||||
it('should evaluate function call without arguments', function() {
|
||||
scope['const'] = function(a,b){return 123;};
|
||||
scope['const'] = function(a, b){return 123;};
|
||||
expect(scope.$eval("const()")).toEqual(123);
|
||||
});
|
||||
|
||||
it('should evaluate function call with arguments', function() {
|
||||
scope.add = function(a,b) {
|
||||
scope.add = function(a, b) {
|
||||
return a+b;
|
||||
};
|
||||
expect(scope.$eval("add(1,2)")).toEqual(3);
|
||||
|
||||
Reference in New Issue
Block a user