Skip to content

Commit

Permalink
Fix client tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Oct 14, 2024
1 parent 279c8e1 commit c9717ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,7 @@ it('calls flag-details-changed inspectors when all flag values change', async ()
'moonshot-demo': { reason: null, value: true, variationIndex: 0 },
test1: { reason: null, value: 's1', variationIndex: 0 },
'this-is-a-test': { reason: null, value: true, variationIndex: 0 },
'has-prereq-depth-1': { reason: { kind: 'FALLTHROUGH' }, value: true, variationIndex: 0 },
'is-prereq': { reason: { kind: 'FALLTHROUGH' }, value: true, variationIndex: 0 },
});
});
7 changes: 5 additions & 2 deletions packages/shared/sdk-client/src/evaluation/evaluationDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ export function createSuccessEvaluationDetail(
reason?: LDEvaluationReason,
prerequisites?: string[],
): LDEvaluationDetail {
return {
const res: LDEvaluationDetail = {
value,
variationIndex: variationIndex ?? null,
reason: reason ?? null,
prerequisites,
};
if (prerequisites) {
res.prerequisites = prerequisites;
}
return res;
}

0 comments on commit c9717ce

Please sign in to comment.