Skip to content

Commit

Permalink
fix: remove only test and small robustness regression (#357)
Browse files Browse the repository at this point in the history
* test: remove only test

* fix issues with tests

* remove nocompats

Co-authored-by: Kelvin Lu <kellu1997@gmail.com>
  • Loading branch information
jooohhn and kelvin-lu authored Feb 24, 2021
1 parent 0b6a985 commit 9f7b036
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/amplitude-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ AmplitudeClient.prototype.identify = function (identify_obj, opt_callback) {
}

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

Expand Down Expand Up @@ -1196,7 +1196,7 @@ AmplitudeClient.prototype.groupIdentify = function (group_type, group_name, iden
}

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

Expand Down Expand Up @@ -1524,7 +1524,7 @@ AmplitudeClient.prototype.logRevenueV2 = function logRevenueV2(revenue_obj) {
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var logLevels = {
let logLevel = logLevels.WARN;

const setLogLevel = function setLogLevel(logLevelName) {
if (Object.prototype.hasOwnProperty.call(logLevels, logLevel)) {
if (Object.prototype.hasOwnProperty.call(logLevels, logLevelName)) {
logLevel = logLevels[logLevelName];
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/amplitude-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ describe('AmplitudeClient', function () {
assert.equal(message, 'success');
});

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

0 comments on commit 9f7b036

Please sign in to comment.