Skip to content

Commit 9f7b036

Browse files
jooohhnkelvin-lu
andauthored
fix: remove only test and small robustness regression (#357)
* test: remove only test * fix issues with tests * remove nocompats Co-authored-by: Kelvin Lu <[email protected]>
1 parent 0b6a985 commit 9f7b036

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/amplitude-client.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ AmplitudeClient.prototype.identify = function (identify_obj, opt_callback) {
11401140
}
11411141

11421142
// if identify input is a proxied object created by the async loading snippet, convert it into an identify object
1143-
if (Object.prototype.hasOwnProperty.call(identify_obj, '_q')) {
1143+
if (type(identify_obj) === 'object' && Object.prototype.hasOwnProperty.call(identify_obj, '_q')) {
11441144
identify_obj = _convertProxyObjectToRealObject(new Identify(), identify_obj);
11451145
}
11461146

@@ -1196,7 +1196,7 @@ AmplitudeClient.prototype.groupIdentify = function (group_type, group_name, iden
11961196
}
11971197

11981198
// if identify input is a proxied object created by the async loading snippet, convert it into an identify object
1199-
if (Object.prototype.hasOwnProperty.call(identify_obj, '_q')) {
1199+
if (type(identify_obj) === 'object' && Object.prototype.hasOwnProperty.call(identify_obj, '_q')) {
12001200
identify_obj = _convertProxyObjectToRealObject(new Identify(), identify_obj);
12011201
}
12021202

@@ -1524,7 +1524,7 @@ AmplitudeClient.prototype.logRevenueV2 = function logRevenueV2(revenue_obj) {
15241524
}
15251525

15261526
// if revenue input is a proxied object created by the async loading snippet, convert it into an revenue object
1527-
if (Object.prototype.hasOwnProperty.call(revenue_obj, '_q')) {
1527+
if (type(revenue_obj) === 'object' && Object.prototype.hasOwnProperty.call(revenue_obj, '_q')) {
15281528
revenue_obj = _convertProxyObjectToRealObject(new Revenue(), revenue_obj);
15291529
}
15301530

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var logLevels = {
1111
let logLevel = logLevels.WARN;
1212

1313
const setLogLevel = function setLogLevel(logLevelName) {
14-
if (Object.prototype.hasOwnProperty.call(logLevels, logLevel)) {
14+
if (Object.prototype.hasOwnProperty.call(logLevels, logLevelName)) {
1515
logLevel = logLevels[logLevelName];
1616
}
1717
};

test/amplitude-client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ describe('AmplitudeClient', function () {
19451945
assert.equal(message, 'success');
19461946
});
19471947

1948-
it.only('should run the callback even with a dropped unsent event', function () {
1948+
it('should run the callback even with a dropped unsent event', function () {
19491949
amplitude.init(apiKey, null, { savedMaxCount: 1 });
19501950
var counter = 0;
19511951
var value = null;

0 commit comments

Comments
 (0)