You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -158,6 +158,12 @@ tape('Node.js Redis', function (t) {
158
158
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_on_negated'),'off','Evaluations using Redis storage should be correct.');
159
159
assert.equal(awaitclient.getTreatment('other_key','always-on-impressions-disabled-true'),'on','Evaluations using Redis storage should be correct.');
160
160
161
+
// Verify impressionsDisabled option
162
+
assert.deepEqual(awaitclient.getTreatment('other_key','always-on',undefined,{impressionsDisabled: true}),'on','Evaluations with impressionsDisabled: true should be correct.');
163
+
assert.deepEqual(awaitclient.getTreatmentWithConfig('other_key','always-on',undefined,{impressionsDisabled: true}),{treatment: 'on',config: null},'Evaluations with impressionsDisabled: true should be correct.');
164
+
assert.deepEqual(awaitclient.getTreatments('other_key',['always-on'],undefined,{impressionsDisabled: true}),{'always-on': 'on'},'Evaluations with impressionsDisabled: true should be correct.');
165
+
assert.deepEqual(awaitclient.getTreatmentsWithConfig('other_key',['always-on'],undefined,{impressionsDisabled: true}),{'always-on': {treatment: 'on',config: null}},'Evaluations with impressionsDisabled: true should be correct.');
166
+
161
167
// Evaluations with rule-based segments
162
168
assert.equal(awaitclient.getTreatment('emi@split.io','rbs_test_flag'),'v2','key in excluded segment');
assert.deepEqual(trackedImpressionCounts,[`always-on-impressions-disabled-true::${truncateTimeFrame(timeFrame)}`,'1',],'Tracked impression counts should be stored in Redis TODO');
198
+
assert.deepEqual(trackedImpressionCounts,[`always-on-impressions-disabled-true::${truncateTimeFrame(timeFrame)}`,'1',`always-on::${truncateTimeFrame(timeFrame)}`,'4',],'Tracked impression counts should be stored in Redis TODO');
assert.deepEqual(storedUniqueKeys,[{'f': 'always-on-impressions-disabled-true','ks': ['other_key']}],'Unique keys should be stored in Redis TODO');
202
+
assert.deepEqual(storedUniqueKeys,[{'f': 'always-on-impressions-disabled-true','ks': ['other_key']},{f: 'always-on',ks: ['other_key']}],'Unique keys should be stored in Redis TODO');
@@ -308,6 +314,12 @@ tape('Node.js Redis', function (t) {
308
314
// this should be deduped
309
315
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_on_negated'),'off','Evaluations using Redis storage should be correct.');
310
316
317
+
// Verify impressionsDisabled option
318
+
assert.deepEqual(awaitclient.getTreatment('other_key','always-on',undefined,{impressionsDisabled: true}),'on','Evaluations with impressionsDisabled: true should be correct.');
319
+
assert.deepEqual(awaitclient.getTreatmentWithConfig('other_key','always-on',undefined,{impressionsDisabled: true}),{treatment: 'on',config: null},'Evaluations with impressionsDisabled: true should be correct.');
320
+
assert.deepEqual(awaitclient.getTreatments('other_key',['always-on'],undefined,{impressionsDisabled: true}),{'always-on': 'on'},'Evaluations with impressionsDisabled: true should be correct.');
321
+
assert.deepEqual(awaitclient.getTreatmentsWithConfig('other_key',['always-on'],undefined,{impressionsDisabled: true}),{'always-on': {treatment: 'on',config: null}},'Evaluations with impressionsDisabled: true should be correct.');
322
+
311
323
assert.equal(typeofclient.track('nicolas@split.io','user','test.redis.event',18).then,'function','Track calls should always return a promise on Redis mode.');
312
324
assert.equal(typeofclient.track().then,'function','Track calls should always return a promise on Redis mode, even when parameters are incorrect.');
313
325
@@ -357,7 +369,7 @@ tape('Node.js Redis', function (t) {
@@ -404,6 +416,12 @@ tape('Node.js Redis', function (t) {
404
416
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_off'),'off','Evaluations using Redis storage should be correct.');
405
417
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_on_negated'),'off','Evaluations using Redis storage should be correct.');
406
418
419
+
// Verify impressionsDisabled option
420
+
assert.deepEqual(awaitclient.getTreatment('other_key','always-on',undefined,{impressionsDisabled: true}),'on','Evaluations with impressionsDisabled: true should be correct.');
421
+
assert.deepEqual(awaitclient.getTreatmentWithConfig('other_key','always-on',undefined,{impressionsDisabled: true}),{treatment: 'on',config: null},'Evaluations with impressionsDisabled: true should be correct.');
422
+
assert.deepEqual(awaitclient.getTreatments('other_key',['always-on'],undefined,{impressionsDisabled: true}),{'always-on': 'on'},'Evaluations with impressionsDisabled: true should be correct.');
423
+
assert.deepEqual(awaitclient.getTreatmentsWithConfig('other_key',['always-on'],undefined,{impressionsDisabled: true}),{'always-on': {treatment: 'on',config: null}},'Evaluations with impressionsDisabled: true should be correct.');
424
+
407
425
assert.equal(typeofclient.track('nicolas@split.io','user','test.redis.event',18).then,'function','Track calls should always return a promise on Redis mode.');
408
426
assert.equal(typeofclient.track().then,'function','Track calls should always return a promise on Redis mode, even when parameters are incorrect.');
0 commit comments