Skip to content

Commit 0d034b2

Browse files
[FSSDK-11528] test improvement
1 parent aa3381e commit 0d034b2

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/core/decision_service/index.spec.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,11 +1933,10 @@ describe('DecisionService', () => {
19331933
});
19341934
});
19351935

1936-
it("should consider global holdout even if local holdout is present", async () => {
1936+
it.only("should consider global holdout even if local holdout is present", async () => {
19371937
const { decisionService } = getDecisionService();
19381938
const datafile = getHoldoutTestDatafile();
1939-
1940-
datafile.holdouts.push({
1939+
const newEntry = {
19411940
id: 'holdout_included_id',
19421941
key: 'holdout_included',
19431942
status: 'Running',
@@ -1949,17 +1948,17 @@ describe('DecisionService', () => {
19491948
{
19501949
id: 'holdout_variation_included_id',
19511950
key: 'holdout_variation_included',
1952-
variables: []
1953-
}
1951+
variables: [],
1952+
},
19541953
],
19551954
trafficAllocation: [
19561955
{
19571956
entityId: 'holdout_variation_included_id',
1958-
endOfRange: 5000
1959-
}
1960-
]
1961-
});
1962-
1957+
endOfRange: 5000,
1958+
},
1959+
],
1960+
};
1961+
datafile.holdouts = [newEntry, ...datafile.holdouts];
19631962
const config = createProjectConfig(datafile);
19641963
const user = new OptimizelyUserContext({
19651964
optimizely: {} as any,
@@ -1968,7 +1967,6 @@ describe('DecisionService', () => {
19681967
age: 20, // satisfies both global holdout (age_22) and included holdout (age_40) audiences
19691968
},
19701969
});
1971-
19721970
const feature = config.featureKeyMap['flag_1'];
19731971
const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get();
19741972

0 commit comments

Comments
 (0)