File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -185,8 +185,14 @@ describe('HEAP', function() {
185
185
} ) ;
186
186
187
187
it ( 'should use control function, if started with function argument' , function ( done ) {
188
+ // Fix for Windows
189
+ var checked = false ;
188
190
profiler . takeSnapshot ( function ( progress , total ) {
189
- if ( progress === total ) done ( ) ;
191
+ if ( progress === total ) {
192
+ if ( checked ) return ;
193
+ checked = true ;
194
+ done ( ) ;
195
+ }
190
196
} ) ;
191
197
} ) ;
192
198
@@ -261,6 +267,13 @@ describe('HEAP', function() {
261
267
} ) ;
262
268
} ) ;
263
269
270
+ it ( 'should compare itself with other snapshot' , function ( ) {
271
+ var snapshot1 = profiler . takeSnapshot ( ) ;
272
+ var snapshot2 = profiler . takeSnapshot ( ) ;
273
+
274
+ expect ( snapshot1 . compare . bind ( snapshot1 , snapshot2 ) ) . to . not . throw ( ) ;
275
+ } ) ;
276
+
264
277
} ) ;
265
278
266
279
function deleteAllSnapshots ( ) {
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ Snapshot.prototype.compare = function(other) {
29
29
keys . forEach ( function ( key ) {
30
30
if ( key in diff ) return ;
31
31
32
- var selfCount = selfCounts [ key ] || 0 ,
33
- otherCount = otherCounts [ key ] || 0 ;
32
+ var selfCount = selfHist [ key ] || 0 ,
33
+ otherCount = otherHist [ key ] || 0 ;
34
34
35
35
diff [ key ] = otherCount - selfCount ;
36
36
} ) ;
You can’t perform that action at this time.
0 commit comments