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
Copy file name to clipboardExpand all lines: src/__tests__/consumer/node_redis.spec.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -104,13 +104,13 @@ tape('Node.js Redis', function (t) {
104
104
constclient=sdk.client();
105
105
constmanager=sdk.manager();
106
106
107
-
/** Evaluation, track and manager methods before SDK_READY */
108
-
client.getTreatment('UT_Segment_member','UT_IN_SEGMENT').then(result=>assert.equal(result,'control','Evaluations using Redis storage should be control until connection is stablished.'));
109
-
client.getTreatment('other','UT_IN_SEGMENT').then(result=>assert.equal(result,'control','Evaluations using Redis storage should be control until connection is stablished.'));
107
+
/** Evaluation, track and manager methods before SDK_READY (but SDK_READY_FROM_CACHE) */
108
+
client.getTreatment('UT_Segment_member','UT_IN_SEGMENT').then(result=>assert.equal(result,'on','Evaluations using Redis storage should be control until connection is stablished.'));
109
+
client.getTreatment('other','UT_IN_SEGMENT').then(result=>assert.equal(result,'off','Evaluations using Redis storage should be control until connection is stablished.'));
110
110
111
-
manager.names().then((result)=>assert.deepEqual(result,[],'manager `names` method returns an empty list of split names if called before SDK_READY or Redis operation fail'));
112
-
manager.split(expectedSplitName).then((result)=>assert.deepEqual(result,null,'manager `split` method returns a null split view if called before SDK_READY or Redis operation fail'));
113
-
manager.splits().then((result)=>assert.deepEqual(result,[],'manager `splits` method returns an empty list of split views if called before SDK_READY or Redis operation fail'));
111
+
manager.names().then((result)=>assert.equal(result.length,28,'manager `names` method returns an empty list of split names if called before SDK_READY or Redis operation fail'));
112
+
manager.split(expectedSplitName).then((result)=>assert.deepEqual(result,expectedSplitView,'manager `split` method returns a null split view if called before SDK_READY or Redis operation fail'));
113
+
manager.splits().then((result)=>assert.equal(result.length,28,'manager `splits` method returns an empty list of split views if called before SDK_READY or Redis operation fail'));
114
114
115
115
client.track('[email protected]','user','before.ready',18).then((result)=>assert.true(result,'Redis adapter queue "rpush" operations until it is ready.'));
116
116
@@ -464,7 +464,7 @@ tape('Node.js Redis', function (t) {
assert.true(result,'If the event was successfully queued the promise will resolve to true once Redis connection is stablished');
@@ -698,7 +698,7 @@ tape('Node.js Redis', function (t) {
698
698
699
699
constclient=sdk.client();
700
700
701
-
client.getTreatmentsWithConfigByFlagSets('other',['set_one']).then(result=>assert.deepEqual(result,{},'Flag sets evaluations using Redis storage should be empty until connection is ready.'));
701
+
client.getTreatmentsWithConfigByFlagSets('other',['set_one']).then(result=>assert.deepEqual(result,{'always-on': {treatment: 'on',config: null},'always-off': {treatment: 'off',config: null}},'Flag sets evaluations using Redis storage should be empty until connection is ready.'));
Copy file name to clipboardExpand all lines: src/__tests__/mocks/redis-commands.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,6 @@ SET 'REDIS_NODE_UT.SPLITIO.splits.till' 1492723024413
42
42
SET 'REDIS_NODE_UT.SPLITIO.split.always-on-impressions-disabled-true' '{"changeNumber":1487277320548,"trafficTypeName":"user","name":"always-on-impressions-disabled-true","impressionsDisabled":true,"seed":1684183541,"status":"ACTIVE","killed":false,"defaultTreatment":"off","conditions":[{"matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user","attribute":""},"matcherType":"ALL_KEYS","negate":false,"userDefinedSegmentMatcherData":{"segmentName":""},"unaryNumericMatcherData":{"dataType":"","value":0},"whitelistMatcherData":{"whitelist":null},"betweenMatcherData":{"dataType":"","start":0,"end":0}}]},"partitions":[{"treatment":"on","size":100},{"treatment":"off","size":0}],"label":"in segment all"}]}'
43
43
SET 'REDIS_NODE_UT.SPLITIO.split.rbs_test_flag' '{"changeNumber":10,"trafficTypeName":"user","name":"rbs_test_flag","trafficAllocation":100,"trafficAllocationSeed":1828377380,"seed":-286617921,"status":"ACTIVE","killed":false,"defaultTreatment":"off","algo":2,"conditions":[{"conditionType":"ROLLOUT","matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user"},"matcherType":"IN_RULE_BASED_SEGMENT","negate":false,"userDefinedSegmentMatcherData":{"segmentName":"test_rule_based_segment"}}]},"partitions":[{"treatment":"v1","size":100},{"treatment":"v2","size":0}],"label":"in rule based segment test_rule_based_segment"},{"conditionType":"ROLLOUT","matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user"},"matcherType":"ALL_KEYS","negate":false}]},"partitions":[{"treatment":"v1","size":0},{"treatment":"v2","size":100}],"label":"default rule"}],"configurations":{},"sets":[],"impressionsDisabled":false}'
44
44
SET 'REDIS_NODE_UT.SPLITIO.split.rbs_test_flag_negated' '{"changeNumber":10,"trafficTypeName":"user","name":"rbs_test_flag_negated","trafficAllocation":100,"trafficAllocationSeed":1828377380,"seed":-286617921,"status":"ACTIVE","killed":false,"defaultTreatment":"off","algo":2,"conditions":[{"conditionType":"ROLLOUT","matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user"},"matcherType":"IN_RULE_BASED_SEGMENT","negate":true,"userDefinedSegmentMatcherData":{"segmentName":"test_rule_based_segment"}}]},"partitions":[{"treatment":"v1","size":100},{"treatment":"v2","size":0}],"label":"not in rule based segment test_rule_based_segment"},{"conditionType":"ROLLOUT","matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user"},"matcherType":"ALL_KEYS","negate":false}]},"partitions":[{"treatment":"v1","size":0},{"treatment":"v2","size":100}],"label":"default rule"}],"configurations":{},"sets":[],"impressionsDisabled":false}'
45
-
SET 'REDIS_NODE_UT.SPLITIO.rbsegment.test_rule_based_segment' '{"changeNumber":5,"name":"test_rule_based_segment","status":"ACTIVE","trafficTypeName":"user","excluded":{"keys":["[email protected]","[email protected]"],"segments":["segment_excluded_by_rbs"]},"conditions":[{"matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user"},"matcherType":"ENDS_WITH","negate":false,"whitelistMatcherData":{"whitelist":["@split.io"]}}]}}]}'
45
+
SET 'REDIS_NODE_UT.SPLITIO.rbsegment.test_rule_based_segment' '{"changeNumber":5,"name":"test_rule_based_segment","status":"ACTIVE","trafficTypeName":"user","excluded":{"keys":["[email protected]","[email protected]"],"segments":[{"type":"standard","name":"segment_excluded_by_rbs"}]},"conditions":[{"matcherGroup":{"combiner":"AND","matchers":[{"keySelector":{"trafficType":"user"},"matcherType":"ENDS_WITH","negate":false,"whitelistMatcherData":{"whitelist":["@split.io"]}}]}}]}'
46
46
SET 'REDIS_NODE_UT.SPLITIO.rbsegments.till' 1492723024413
0 commit comments