Skip to content

Commit 16a6ff1

Browse files
committed
updated test
1 parent 4718eba commit 16a6ff1

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

amplitude.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
266266
Amplitude.prototype._sendEventsIfReady = function(callback) {
267267
if (this._unsentEvents.length === 0) {
268268
return false;

src/amplitude.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
154154
Amplitude.prototype._sendEventsIfReady = function(callback) {
155155
if (this._unsentEvents.length === 0) {
156156
return false;

test/amplitude.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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 () {

0 commit comments

Comments
 (0)