This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 3 files changed +10
-26
lines changed
3 files changed +10
-26
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ angular.mock.$Browser = function() {
75
75
} ;
76
76
77
77
78
+ /**
79
+ * @name ngMock.$browser#defer.now
80
+ * @propertyOf ngMock.$browser
81
+ *
82
+ * @description
83
+ * Current milliseconds mock time.
84
+ */
78
85
self . defer . now = 0 ;
79
86
80
87
@@ -119,29 +126,6 @@ angular.mock.$Browser = function() {
119
126
}
120
127
} ;
121
128
122
- /**
123
- * @name ngMock.$browser#defer.flushNext
124
- * @methodOf ngMock.$browser
125
- *
126
- * @description
127
- * Flushes next pending request and compares it to the provided delay
128
- *
129
- * @param {number= } expectedDelay the delay value that will be asserted against the delay of the next timeout function
130
- */
131
- self . defer . flushNext = function ( expectedDelay ) {
132
- var tick = self . deferredFns . shift ( ) ;
133
- expect ( tick . time ) . toEqual ( expectedDelay ) ;
134
- tick . fn ( ) ;
135
- } ;
136
-
137
- /**
138
- * @name ngMock.$browser#defer.now
139
- * @propertyOf ngMock.$browser
140
- *
141
- * @description
142
- * Current milliseconds mock time.
143
- */
144
-
145
129
self . $$baseHref = '' ;
146
130
self . baseHref = function ( ) {
147
131
return this . $$baseHref ;
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ describe('$timeout', function() {
77
77
var promise2 = $timeout ( function ( ) { } , 100 , false ) ;
78
78
expect ( cancelSpy ) . not . toHaveBeenCalled ( ) ;
79
79
80
- $timeout . flushNext ( 0 ) ;
80
+ $timeout . flush ( 0 ) ;
81
81
82
82
// Promise1 deferred object should already be removed from the list and not cancellable
83
83
$timeout . cancel ( promise1 ) ;
Original file line number Diff line number Diff line change @@ -417,9 +417,9 @@ describe('ngMock', function() {
417
417
418
418
$timeout ( iterate , 100 ) ;
419
419
$timeout ( iterate , 123 ) ;
420
- $timeout . flushNext ( 100 ) ;
420
+ $timeout . flush ( 100 ) ;
421
421
expect ( count ) . toBe ( 1 ) ;
422
- $timeout . flushNext ( 123 ) ;
422
+ $timeout . flush ( 123 ) ;
423
423
expect ( count ) . toBe ( 2 ) ;
424
424
} ) ) ;
425
425
} ) ;
You can’t perform that action at this time.
0 commit comments