@@ -14,49 +14,49 @@ describe('FallbacksSanitizer', () => {
1414 } ) ;
1515
1616 describe ( 'isValidFlagName' , ( ) => {
17- it ( 'returns true for a valid flag name' , ( ) => {
17+ test ( 'returns true for a valid flag name' , ( ) => {
1818 // @ts -expect-private-access
1919 expect ( ( FallbacksSanitizer as any ) . isValidFlagName ( 'my_flag' ) ) . toBe ( true ) ;
2020 } ) ;
2121
22- it ( 'returns false for a name longer than 100 chars' , ( ) => {
22+ test ( 'returns false for a name longer than 100 chars' , ( ) => {
2323 const longName = 'a' . repeat ( 101 ) ;
2424 expect ( ( FallbacksSanitizer as any ) . isValidFlagName ( longName ) ) . toBe ( false ) ;
2525 } ) ;
2626
27- it ( 'returns false if the name contains spaces' , ( ) => {
27+ test ( 'returns false if the name contains spaces' , ( ) => {
2828 expect ( ( FallbacksSanitizer as any ) . isValidFlagName ( 'invalid flag' ) ) . toBe ( false ) ;
2929 } ) ;
3030 } ) ;
3131
3232 describe ( 'isValidTreatment' , ( ) => {
33- it ( 'returns true for a valid treatment string' , ( ) => {
33+ test ( 'returns true for a valid treatment string' , ( ) => {
3434 expect ( ( FallbacksSanitizer as any ) . isValidTreatment ( validTreatment ) ) . toBe ( true ) ;
3535 } ) ;
3636
37- it ( 'returns false for null or undefined' , ( ) => {
37+ test ( 'returns false for null or undefined' , ( ) => {
3838 expect ( ( FallbacksSanitizer as any ) . isValidTreatment ( null ) ) . toBe ( false ) ;
3939 expect ( ( FallbacksSanitizer as any ) . isValidTreatment ( undefined ) ) . toBe ( false ) ;
4040 } ) ;
4141
42- it ( 'returns false for a treatment longer than 100 chars' , ( ) => {
42+ test ( 'returns false for a treatment longer than 100 chars' , ( ) => {
4343 const long = { treatment : 'a' . repeat ( 101 ) } ;
4444 expect ( ( FallbacksSanitizer as any ) . isValidTreatment ( long ) ) . toBe ( false ) ;
4545 } ) ;
4646
47- it ( 'returns false if treatment does not match regex pattern' , ( ) => {
47+ test ( 'returns false if treatment does not match regex pattern' , ( ) => {
4848 const invalid = { treatment : 'invalid treatment!' } ;
4949 expect ( ( FallbacksSanitizer as any ) . isValidTreatment ( invalid ) ) . toBe ( false ) ;
5050 } ) ;
5151 } ) ;
5252
5353 describe ( 'sanitizeGlobal' , ( ) => {
54- it ( 'returns the treatment if valid' , ( ) => {
54+ test ( 'returns the treatment if valid' , ( ) => {
5555 expect ( FallbacksSanitizer . sanitizeGlobal ( validTreatment ) ) . toEqual ( validTreatment ) ;
5656 expect ( console . error ) . not . toHaveBeenCalled ( ) ;
5757 } ) ;
5858
59- it ( 'returns undefined and logs error if invalid' , ( ) => {
59+ test ( 'returns undefined and logs error if invalid' , ( ) => {
6060 const result = FallbacksSanitizer . sanitizeGlobal ( invalidTreatment ) ;
6161 expect ( result ) . toBeUndefined ( ) ;
6262 expect ( console . error ) . toHaveBeenCalledWith (
@@ -66,7 +66,7 @@ describe('FallbacksSanitizer', () => {
6666 } ) ;
6767
6868 describe ( 'sanitizeByFlag' , ( ) => {
69- it ( 'returns a sanitized map with valid entries only' , ( ) => {
69+ test ( 'returns a sanitized map with valid entries only' , ( ) => {
7070 const input = {
7171 valid_flag : validTreatment ,
7272 'invalid flag' : validTreatment ,
@@ -79,7 +79,7 @@ describe('FallbacksSanitizer', () => {
7979 expect ( console . error ) . toHaveBeenCalledTimes ( 2 ) ; // invalid flag + bad_treatment
8080 } ) ;
8181
82- it ( 'returns empty object if all invalid' , ( ) => {
82+ test ( 'returns empty object if all invalid' , ( ) => {
8383 const input = {
8484 'invalid flag' : invalidTreatment ,
8585 } ;
@@ -89,7 +89,7 @@ describe('FallbacksSanitizer', () => {
8989 expect ( console . error ) . toHaveBeenCalled ( ) ;
9090 } ) ;
9191
92- it ( 'returns same object if all valid' , ( ) => {
92+ test ( 'returns same object if all valid' , ( ) => {
9393 const input = {
9494 flag_one : validTreatment ,
9595 flag_two : { treatment : 'valid_2' , config : null } ,
0 commit comments