1
1
import { IAssignmentEvent } from './assignment-logger' ;
2
+ import { AllocationEvaluationCode } from './flag-evaluation-details-builder' ;
2
3
3
4
describe ( 'IAssignmentEvent' , ( ) => {
4
5
it ( 'should allow adding arbitrary fields' , ( ) => {
@@ -11,6 +12,25 @@ describe('IAssignmentEvent', () => {
11
12
timestamp : new Date ( ) . toISOString ( ) ,
12
13
subjectAttributes : { age : 25 , country : 'USA' } ,
13
14
holdoutKey : 'holdout_key_123' ,
15
+ evaluationDetails : {
16
+ environmentName : 'Test' ,
17
+ variationKey : 'variationKey' ,
18
+ variationValue : 'variation_123' ,
19
+ banditKey : null ,
20
+ banditAction : null ,
21
+ flagEvaluationCode : 'MATCH' ,
22
+ flagEvaluationDescription : '' ,
23
+ configFetchedAt : new Date ( ) . toISOString ( ) ,
24
+ configPublishedAt : new Date ( ) . toISOString ( ) ,
25
+ matchedRule : null ,
26
+ matchedAllocation : {
27
+ key : 'allocation_123' ,
28
+ allocationEvaluationCode : AllocationEvaluationCode . MATCH ,
29
+ orderPosition : 1 ,
30
+ } ,
31
+ unmatchedAllocations : [ ] ,
32
+ unevaluatedAllocations : [ ] ,
33
+ } ,
14
34
} ;
15
35
16
36
expect ( event . holdoutKey ) . toBe ( 'holdout_key_123' ) ;
0 commit comments