File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ Amplitude.prototype.nextEventId = function() {
262262 return this . _eventId ;
263263} ;
264264
265- // returns true if sendEvents called
265+ // returns true if sendEvents called immediately
266266Amplitude . prototype . _sendEventsIfReady = function ( callback ) {
267267 if ( this . _unsentEvents . length === 0 ) {
268268 return false ;
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ Amplitude.prototype.nextEventId = function() {
150150 return this . _eventId ;
151151} ;
152152
153- // returns true if sendEvents called
153+ // returns true if sendEvents called immediately
154154Amplitude . prototype . _sendEventsIfReady = function ( callback ) {
155155 if ( this . _unsentEvents . length === 0 ) {
156156 return false ;
Original file line number Diff line number Diff line change @@ -426,9 +426,17 @@ describe('Amplitude', function() {
426426
427427 it ( 'should run callback if no eventType' , function ( ) {
428428 var counter = 0 ;
429- var callback = function ( status , response ) { counter ++ ; }
429+ var value = - 1 ;
430+ var message = '' ;
431+ var callback = function ( status , response ) {
432+ counter ++ ;
433+ value = status ;
434+ message = response ;
435+ }
430436 amplitude . logEvent ( null , null , callback ) ;
431437 assert . equal ( counter , 1 ) ;
438+ assert . equal ( value , 0 ) ;
439+ assert . equal ( message , 'No request sent' ) ;
432440 } ) ;
433441
434442 it ( 'should run callback if optout' , function ( ) {
You can’t perform that action at this time.
0 commit comments