@@ -115,6 +115,7 @@ describe('LaunchDarklyClientProvider', () => {
115115 it ( 'handles correct return types for boolean variations' , ( ) => {
116116 ldClientMock . variationDetail = jest . fn ( ) . mockReturnValue ( {
117117 value : true ,
118+ variationIndex : 0 ,
118119 reason : {
119120 kind : 'OFF' ,
120121 } ,
@@ -123,8 +124,10 @@ describe('LaunchDarklyClientProvider', () => {
123124 const res = ofClient . getBooleanDetails ( testFlagKey , false ) ;
124125 expect ( res ) . toEqual ( {
125126 flagKey : testFlagKey ,
127+ flagMetadata : { } ,
126128 value : true ,
127129 reason : 'OFF' ,
130+ variant : '0' ,
128131 } ) ;
129132 } ) ;
130133
@@ -139,6 +142,7 @@ describe('LaunchDarklyClientProvider', () => {
139142 const res = ofClient . getBooleanDetails ( testFlagKey , false ) ;
140143 expect ( res ) . toEqual ( {
141144 flagKey : testFlagKey ,
145+ flagMetadata : { } ,
142146 value : false ,
143147 reason : 'ERROR' ,
144148 errorCode : 'TYPE_MISMATCH' ,
@@ -168,6 +172,7 @@ describe('LaunchDarklyClientProvider', () => {
168172 it ( 'handles correct return types for numeric variations' , ( ) => {
169173 ldClientMock . variationDetail = jest . fn ( ) . mockReturnValue ( {
170174 value : 17 ,
175+ variationIndex : 0 ,
171176 reason : {
172177 kind : 'OFF' ,
173178 } ,
@@ -176,8 +181,10 @@ describe('LaunchDarklyClientProvider', () => {
176181 const res = ofClient . getNumberDetails ( testFlagKey , 0 ) ;
177182 expect ( res ) . toEqual ( {
178183 flagKey : testFlagKey ,
184+ flagMetadata : { } ,
179185 value : 17 ,
180186 reason : 'OFF' ,
187+ variant : '0' ,
181188 } ) ;
182189 } ) ;
183190
@@ -192,6 +199,7 @@ describe('LaunchDarklyClientProvider', () => {
192199 const res = ofClient . getNumberDetails ( testFlagKey , 0 ) ;
193200 expect ( res ) . toEqual ( {
194201 flagKey : testFlagKey ,
202+ flagMetadata : { } ,
195203 value : 0 ,
196204 reason : 'ERROR' ,
197205 errorCode : 'TYPE_MISMATCH' ,
@@ -220,6 +228,7 @@ describe('LaunchDarklyClientProvider', () => {
220228 it ( 'handles correct return types for object variations' , ( ) => {
221229 ldClientMock . variationDetail = jest . fn ( ) . mockReturnValue ( {
222230 value : { some : 'value' } ,
231+ variationIndex : 0 ,
223232 reason : {
224233 kind : 'OFF' ,
225234 } ,
@@ -228,8 +237,10 @@ describe('LaunchDarklyClientProvider', () => {
228237 const res = ofClient . getObjectDetails ( testFlagKey , { } ) ;
229238 expect ( res ) . toEqual ( {
230239 flagKey : testFlagKey ,
240+ flagMetadata : { } ,
231241 value : { some : 'value' } ,
232242 reason : 'OFF' ,
243+ variant : '0' ,
233244 } ) ;
234245 } ) ;
235246
@@ -244,6 +255,7 @@ describe('LaunchDarklyClientProvider', () => {
244255 const res = ofClient . getObjectDetails ( testFlagKey , { } ) ;
245256 expect ( res ) . toEqual ( {
246257 flagKey : testFlagKey ,
258+ flagMetadata : { } ,
247259 value : { } ,
248260 reason : 'ERROR' ,
249261 errorCode : 'TYPE_MISMATCH' ,
@@ -272,6 +284,7 @@ describe('LaunchDarklyClientProvider', () => {
272284 it ( 'handles correct return types for string variations' , ( ) => {
273285 ldClientMock . variationDetail = jest . fn ( ) . mockReturnValue ( {
274286 value : 'good' ,
287+ variationIndex : 0 ,
275288 reason : {
276289 kind : 'OFF' ,
277290 } ,
@@ -280,8 +293,10 @@ describe('LaunchDarklyClientProvider', () => {
280293 const res = ofClient . getStringDetails ( testFlagKey , 'default' ) ;
281294 expect ( res ) . toEqual ( {
282295 flagKey : testFlagKey ,
296+ flagMetadata : { } ,
283297 value : 'good' ,
284298 reason : 'OFF' ,
299+ variant : '0' ,
285300 } ) ;
286301 } ) ;
287302
@@ -296,6 +311,7 @@ describe('LaunchDarklyClientProvider', () => {
296311 const res = ofClient . getStringDetails ( testFlagKey , 'default' ) ;
297312 expect ( res ) . toEqual ( {
298313 flagKey : testFlagKey ,
314+ flagMetadata : { } ,
299315 value : 'default' ,
300316 reason : 'ERROR' ,
301317 errorCode : 'TYPE_MISMATCH' ,
@@ -322,9 +338,11 @@ describe('LaunchDarklyClientProvider', () => {
322338 const res = ofClient . getObjectDetails ( testFlagKey , { } ) ;
323339 expect ( res ) . toEqual ( {
324340 flagKey : testFlagKey ,
341+ flagMetadata : { } ,
325342 value : { yes : 'no' } ,
326343 reason : 'ERROR' ,
327344 errorCode : ofError ,
345+ variant : undefined ,
328346 } ) ;
329347 } ) ;
330348
@@ -340,6 +358,7 @@ describe('LaunchDarklyClientProvider', () => {
340358 const res = ofClient . getObjectDetails ( testFlagKey , { } ) ;
341359 expect ( res ) . toEqual ( {
342360 flagKey : testFlagKey ,
361+ flagMetadata : { } ,
343362 value : { yes : 'no' } ,
344363 variant : '22' ,
345364 reason : 'OFF' ,
0 commit comments