@@ -569,7 +569,7 @@ describe("enhanced feature flags", function () {
569569 parameters : {
570570 Audience : JSON . stringify ( audience ) ,
571571 JsonArray : " [\"one\",\"two\"] " ,
572- PlainText : JSON . stringify ( "not-json" ) ,
572+ PlainText : "not-json" ,
573573 Percentage : "50"
574574 }
575575 } ]
@@ -587,10 +587,10 @@ describe("enhanced feature flags", function () {
587587 expect ( parameters . Audience ) . deep . equals ( audience ) ;
588588 expect ( parameters . JsonArray ) . deep . equals ( [ "one" , "two" ] ) ;
589589 expect ( parameters . PlainText ) . equals ( "not-json" ) ;
590- expect ( parameters . Percentage ) . equals ( 50 ) ;
590+ expect ( parameters . Percentage ) . equals ( "50" ) ;
591591 } ) ;
592592
593- it ( "should throw for invalid JSON in enhanced feature flag filter parameters" , ( ) => {
593+ it ( "should preserve invalid JSON in enhanced feature flag filter parameters as a string " , ( ) => {
594594 const enhancedFeatureFlag = createMockedEnhancedFeatureFlag ( "InvalidParameter" , {
595595 conditions : {
596596 filters : [ {
@@ -600,7 +600,8 @@ describe("enhanced feature flags", function () {
600600 }
601601 } ) ;
602602
603- expectEnhancedFeatureFlagJsonError ( ( ) => convert ( enhancedFeatureFlag ) , "InvalidParameter" ) ;
603+ const featureFlag = convert ( enhancedFeatureFlag ) ;
604+ expect ( featureFlag . conditions . client_filters [ 0 ] . parameters ?. Value ) . equals ( "{not-json}" ) ;
604605 } ) ;
605606
606607 it ( "should parse enhanced feature flag variants based on content type" , ( ) => {
0 commit comments