New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@segment/analytics.js-integration-adobe-target

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/analytics.js-integration-adobe-target - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

@@ -1,50 +0,1 @@

/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
files: [
'test/**/*.test.js'
],
browsers: ['PhantomJS'],
frameworks: ['browserify', 'mocha'],
reporters: ['spec', 'coverage'],
preprocessors: {
'test/**/*.js': 'browserify'
},
client: {
mocha: {
grep: process.env.GREP,
reporter: 'html',
timeout: 10000
}
},
browserify: {
debug: true,
transform: [
[
'browserify-istanbul',
{
instrumenterConfig: {
embedSource: true
}
}
]
]
},
coverageReporter: {
reporters: [
{ type: 'text' },
{ type: 'html' },
{ type: 'json' }
]
}
});
};
module.exports = require('../../karma.conf');

@@ -13,3 +13,3 @@ 'use strict';

var AdobeTarget = module.exports = integration('Adobe Target');
var AdobeTarget = (module.exports = integration('Adobe Target'));

@@ -20,3 +20,7 @@ AdobeTarget.prototype.initialize = function() {

window.adobe.target = window.adobe.target || {};
window.adobe.target.trackEvent = window.adobe.target.trackEvent || function() { /* noop */ };
window.adobe.target.trackEvent =
window.adobe.target.trackEvent ||
function() {
/* noop */
};
this.ready();

@@ -49,3 +53,4 @@ };

for (var i = 0; i < products.length; i++) {
var productId = products[i].id || products[i].productId || products[i].product_id;
var productId =
products[i].id || products[i].productId || products[i].product_id;
if (productId) productIdArray.push(productId);

@@ -57,3 +62,3 @@ }

params: {
orderId: track.orderId(),
orderId: track.orderId(),
orderTotal: track.revenue(),

@@ -60,0 +65,0 @@ productPurchaseId: productIdArray.join(',')

{
"name": "@segment/analytics.js-integration-adobe-target",
"description": "The Adobe Target analytics.js integration.",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [

@@ -13,14 +13,15 @@ "analytics.js",

"scripts": {
"test": "make test"
"test": "karma start",
"test:ci": "karma start karma.conf-ci.js"
},
"repository": {
"type": "git",
"url": ""
},
"author": "Segment <friends@segment.com>",
"license": "SEE LICENSE IN LICENSE",
"homepage": "https://github.com/segmentio/analytics.js-integrations/blob/master/integrations/adobe-target#readme",
"bugs": {
"url": ""
"url": "https://github.com/segmentio/analytics.js-integrations/issues"
},
"homepage": "https://github.com/segment-integrations/analytics.js-integration-adobe-target#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/segmentio/analytics.js-integrations.git"
},
"dependencies": {

@@ -31,26 +32,19 @@ "@segment/analytics.js-integration": "^2.1.0",

"devDependencies": {
"@segment/analytics.js-core": "^3.0.0",
"@segment/analytics.js-integration-tester": "^3.1.0",
"@segment/clear-env": "^2.0.0",
"@segment/eslint-config": "^3.1.1",
"browserify": "^13.0.0",
"browserify-istanbul": "^2.0.0",
"eslint": "^2.9.0",
"eslint-plugin-mocha": "^2.2.0",
"eslint-plugin-require-path-exists": "^1.1.5",
"istanbul": "^0.4.3",
"karma": "1.3.0",
"karma-browserify": "^5.0.4",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-junit-reporter": "^1.0.0",
"karma-mocha": "1.0.1",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sauce-launcher": "^1.0.0",
"karma-spec-reporter": "0.0.26",
"mocha": "^2.2.5",
"npm-check": "^5.2.1",
"phantomjs-prebuilt": "^2.1.7",
"watchify": "^3.7.0"
}
"@segment/analytics.js-core": "^3.8.2",
"@segment/analytics.js-integration-tester": "^3.1.1",
"@segment/clear-env": "^2.1.1",
"browserify": "^16.2.3",
"eslint": "^5.16.0",
"karma": "^4.1.0",
"karma-browserify": "^6.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-sauce-launcher": "^2.0.2",
"karma-spec-reporter": "^0.0.32",
"karma-summary-reporter": "^1.6.0",
"mocha": "^6.1.4",
"watchify": "^3.11.1"
},
"gitHead": "3d20325d1e7433aa6a92b0cdd1cd5678221949d2"
}

@@ -15,3 +15,3 @@ 'use strict';

secureOnly: true,
overrideMboxEdgeServer: true,
overrideMboxEdgeServer: true,
optoutEnabled: true

@@ -35,5 +35,5 @@ };

/*
* Cannot test whether the integration has loaded since customers
* must include at.js manually. Instead, we always call `ready()` to
* prevent blocking other integratinos, even if at.js has not been
* Cannot test whether the integration has loaded since customers
* must include at.js manually. Instead, we always call `ready()` to
* prevent blocking other integratinos, even if at.js has not been
* included properly.

@@ -52,16 +52,20 @@ */

});
it('should send track calls correctly', function() {
analytics.track('Clicked Experiment', {
color: 'red',
variation: 1
}, {
'Adobe Target': {
mboxName: 'experiment'
analytics.track(
'Clicked Experiment',
{
color: 'red',
variation: 1
},
{
'Adobe Target': {
mboxName: 'experiment'
}
}
});
);
analytics.called(window.adobe.target.trackEvent, {
mbox: 'experiment',
mbox: 'experiment',
params: {
color: 'red',
color: 'red',
variation: 1

@@ -71,20 +75,24 @@ }

});
it('should send order completed order calls correctly', function() {
analytics.track('Order Completed', {
orderId: '12345',
revenue: 100,
products: [
{
productId: 'abc'
},
{
productId: '123'
analytics.track(
'Order Completed',
{
orderId: '12345',
revenue: 100,
products: [
{
productId: 'abc'
},
{
productId: '123'
}
]
},
{
'Adobe Target': {
mboxName: 'orderCompleted'
}
]
}, {
'Adobe Target': {
mboxName: 'orderCompleted'
}
});
);
analytics.called(window.adobe.target.trackEvent, {

@@ -98,27 +106,31 @@ mbox: 'orderCompleted',

});
});
});
it('should handle products arrays even if some products have no productId', function() {
analytics.track('Order Completed', {
orderId: '1029384756',
revenue: 250,
products: [
{
productId: '123'
},
{
color: 'red'
},
{
color: 'teal'
},
{
productId: '987'
analytics.track(
'Order Completed',
{
orderId: '1029384756',
revenue: 250,
products: [
{
productId: '123'
},
{
color: 'red'
},
{
color: 'teal'
},
{
productId: '987'
}
]
},
{
'Adobe Target': {
mboxName: 'submittedOrder'
}
]
}, {
'Adobe Target': {
mboxName: 'submittedOrder'
}
});
);
analytics.called(window.adobe.target.trackEvent, {

@@ -136,3 +148,3 @@ mbox: 'submittedOrder',

analytics.track('Clicked Experiment', {
color: 'red',
color: 'red',
variation: 1

@@ -152,15 +164,19 @@ });

it ('should stringify a non-string mbox name', function() {
analytics.track('Clicked Experiment', {
color: 'red',
variation: 1
}, {
'Adobe Target': {
mboxName: 123
it('should stringify a non-string mbox name', function() {
analytics.track(
'Clicked Experiment',
{
color: 'red',
variation: 1
},
{
'Adobe Target': {
mboxName: 123
}
}
});
);
analytics.called(window.adobe.target.trackEvent, {
mbox: '123',
mbox: '123',
params: {
color: 'red',
color: 'red',
variation: 1

@@ -167,0 +183,0 @@ }

Sorry, the diff of this file is not supported yet