Skip to content

Commit c9717ce

Browse files
committed
Fix client tests.
1 parent 279c8e1 commit c9717ce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/shared/sdk-client/__tests__/LDCLientImpl.inspections.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,7 @@ it('calls flag-details-changed inspectors when all flag values change', async ()
187187
'moonshot-demo': { reason: null, value: true, variationIndex: 0 },
188188
test1: { reason: null, value: 's1', variationIndex: 0 },
189189
'this-is-a-test': { reason: null, value: true, variationIndex: 0 },
190+
'has-prereq-depth-1': { reason: { kind: 'FALLTHROUGH' }, value: true, variationIndex: 0 },
191+
'is-prereq': { reason: { kind: 'FALLTHROUGH' }, value: true, variationIndex: 0 },
190192
});
191193
});

packages/shared/sdk-client/src/evaluation/evaluationDetail.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ export function createSuccessEvaluationDetail(
1919
reason?: LDEvaluationReason,
2020
prerequisites?: string[],
2121
): LDEvaluationDetail {
22-
return {
22+
const res: LDEvaluationDetail = {
2323
value,
2424
variationIndex: variationIndex ?? null,
2525
reason: reason ?? null,
26-
prerequisites,
2726
};
27+
if (prerequisites) {
28+
res.prerequisites = prerequisites;
29+
}
30+
return res;
2831
}

0 commit comments

Comments
 (0)