Comparing version 0.1.0 to 0.1.1
@@ -392,3 +392,6 @@ /* | ||
if (!properties) { properties = {}; } | ||
if (typeof(properties) === 'function' || !properties) { | ||
callback = properties; | ||
properties = {}; | ||
} | ||
@@ -395,0 +398,0 @@ if (typeof(amount) !== 'number') { |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/mixpanel/mixpanel-node", | ||
@@ -13,0 +13,0 @@ "author": "Carl Sverre", |
@@ -117,2 +117,3 @@ Mixpanel-node | ||
- [Tobias Baunbæk](https://github.com/freeall) | ||
- [Eduardo Sorribas](https://github.com/sorribas) | ||
@@ -119,0 +120,0 @@ License |
@@ -287,2 +287,38 @@ var Mixpanel = require('../lib/mixpanel-node'), | ||
test.done(); | ||
}, | ||
"supports being called with a callback": function(test) { | ||
var expected_data = { | ||
$append: { $transactions: { $amount: 50 } }, | ||
$token: this.token, | ||
$distinct_id: this.distinct_id | ||
}; | ||
var callback = function() {}; | ||
this.mixpanel.people.track_charge(this.distinct_id, 50, callback); | ||
test.ok( | ||
this.mixpanel.send_request.args[0][2] === callback, | ||
"people.track_charge didn't call send_request with correct arguments" | ||
); | ||
test.done(); | ||
}, | ||
"supports being called with properties and a callback": function(test) { | ||
var expected_data = { | ||
$append: { $transactions: { $amount: 50 } }, | ||
$token: this.token, | ||
$distinct_id: this.distinct_id | ||
}; | ||
var callback = function() {}; | ||
this.mixpanel.people.track_charge(this.distinct_id, 50, {}, callback); | ||
test.ok( | ||
this.mixpanel.send_request.args[0][2] === callback, | ||
"people.track_charge didn't call send_request with correct arguments" | ||
); | ||
test.done(); | ||
} | ||
@@ -289,0 +325,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
49590
1049
124
2