Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit e1185ce

Browse files
authored
Fix the tracking plan when load options are specified (#74)
* Fix the tracking plan when load options are specified * Improve test to catch the bug
1 parent 42622cc commit e1185ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ Analytics.prototype._mergeInitializeAndPlanIntegrations = function(planIntegrati
785785
// Allow the tracking plan to disable integrations that were explicitly
786786
// enabled on initialization
787787
if (planIntegrations.All === false) {
788-
integrations = {};
788+
integrations = { All: false };
789789
}
790790

791791
for (integrationName in planIntegrations) {

test/analytics.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,7 @@ describe('Analytics', function() {
13511351
it('should allow tracking plan to disable integrations explicitly enabled via initialize .integrations option', function() {
13521352
analytics.initialize(settings, {
13531353
integrations: {
1354+
All: false,
13541355
Test: true
13551356
},
13561357
plan: {
@@ -1370,7 +1371,7 @@ describe('Analytics', function() {
13701371

13711372
analytics.track('event2', { prop: true });
13721373
var track2 = analytics._invoke.args[1][1];
1373-
assert.deepEqual(track2.obj.integrations, { Test: false });
1374+
assert.deepEqual(track2.obj.integrations, { All: false, Test: false });
13741375
});
13751376

13761377
it('should prevent tracking plan from enabling integrations disabled via initialize .integrations option', function() {

0 commit comments

Comments
 (0)