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__/browserSuites/impressions-listener.spec.js
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -57,17 +57,21 @@ export default function (assert) {
57
57
keyName: 'marcio@split.io',
58
58
treatment: 'no',
59
59
bucketingKey: 'impr_bucketing_2',
60
-
label: 'default rule'
60
+
label: 'default rule',
61
+
pt: undefined
61
62
};
62
63
63
64
assert.equal(listener.logImpression.callCount,4,'Impression listener logImpression method should be called after we call client.getTreatment, once per each impression generated.');
@@ -150,11 +150,12 @@ tape('Node.js Redis', function (t) {
150
150
151
151
assert.equal(awaitclient.getTreatment('UT_Segment_member','always-on'),'on','Evaluations using Redis storage should be correct.');
152
152
153
-
// Below splits were added manually to the redis_mock.json file.
153
+
// Below feature flags were added manually to the redis_mock.json file.
154
154
// They are all_keys (always evaluate to on) which depend from always-on split. the _on/off is what treatment they are expecting there.
155
155
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_on'),'on','Evaluations using Redis storage should be correct.');
156
156
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_off'),'off','Evaluations using Redis storage should be correct.');
157
157
assert.equal(awaitclient.getTreatment('UT_Segment_member','hierarchical_splits_testing_on_negated'),'off','Evaluations using Redis storage should be correct.');
158
+
assert.equal(awaitclient.getTreatment('other_key','always-on-track-impressions-false'),'on','Evaluations using Redis storage should be correct.');
158
159
159
160
assert.equal(typeofclient.track().then,'function','Track calls should always return a promise on Redis mode, even when parameters are incorrect.');
160
161
@@ -163,35 +164,46 @@ tape('Node.js Redis', function (t) {
163
164
164
165
// Manager methods
165
166
constsplitNames=awaitmanager.names();
166
-
assert.equal(splitNames.length,25,'manager `names` method returns the list of split names asynchronously');
167
+
assert.equal(splitNames.length,26,'manager `names` method returns the list of split names asynchronously');
167
168
assert.equal(splitNames.indexOf(expectedSplitName)>-1,true,'list of split names should contain expected splits');
168
169
assert.deepEqual(awaitmanager.split(expectedSplitName),expectedSplitView,'manager `split` method returns the split view of the given split name asynchronously');
169
170
constsplitViews=awaitmanager.splits();
170
-
assert.equal(splitViews.length,25,'manager `splits` method returns the list of split views asynchronously');
171
+
assert.equal(splitViews.length,26,'manager `splits` method returns the list of split views asynchronously');
171
172
assert.deepEqual(splitViews.find(splitView=>splitView.name===expectedSplitName),expectedSplitView,'manager `split` method returns the split view of the given split name asynchronously');
assert.deepEqual(trackedImpressionCounts,[`always-on-track-impressions-false::${truncateTimeFrame(timeFrame)}`,'1',],'Tracked impression counts should be stored in Redis TODO');
assert.deepEqual(configValue,{oM: 1,st: 'redis',aF: 1,rF: 0},'There is stored telemetry config');
202
+
203
+
// close server connection
204
+
server.close().then(assert.end);
205
+
});
206
+
});
195
207
});
196
208
});
197
209
});
@@ -304,7 +316,7 @@ tape('Node.js Redis', function (t) {
304
316
assert.deepEqual(trackedImpressionsAndEvents,[TOTAL_RAW_IMPRESSIONS-DEDUPED_IMPRESSIONS,TOTAL_EVENTS],'Tracked impressions and events should be stored in Redis');
0 commit comments