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,26,'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,26,'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
@@ -453,7 +453,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');
@@ -687,7 +687,7 @@ tape('Node.js Redis', function (t) {
687
687
688
688
constclient=sdk.client();
689
689
690
-
client.getTreatmentsWithConfigByFlagSets('other',['set_one']).then(result=>assert.deepEqual(result,{},'Flag sets evaluations using Redis storage should be empty until connection is ready.'));
690
+
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.'));
0 commit comments