@@ -197,6 +197,10 @@ describe('string', function () {
197
197
expect ( hideString ( '👨👨👧👦helloworld👨👨👧👦' , { start : 1 , end : - 1 } ) ) . toBe ( '👨👨👧👦**********👨👨👧👦' ) ;
198
198
expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { start : 1 , end : - 1 } ) ) . toBe ( '👨👨👧👦***********👨👨👧👦' ) ;
199
199
expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { start : - 12 , end : - 1 } ) ) . toBe ( '👨👨👧👦***********👨👨👧👦' ) ;
200
+
201
+ expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { start : - 12 , end : - 1 , replacementLen : 1 } ) ) . toBe (
202
+ '👨👨👧👦*👨👨👧👦' ,
203
+ ) ;
200
204
} ) ;
201
205
202
206
it ( 'start,len' , ( ) => {
@@ -213,6 +217,10 @@ describe('string', function () {
213
217
214
218
expect ( hideString ( '👨👨👧👦helloworld👨👨👧👦' , { start : 1 , len : 10 } ) ) . toBe ( '👨👨👧👦**********👨👨👧👦' ) ;
215
219
expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { start : 1 , len : 11 } ) ) . toBe ( '👨👨👧👦***********👨👨👧👦' ) ;
220
+
221
+ expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { start : 1 , len : 11 , replacementLen : 1 } ) ) . toBe (
222
+ '👨👨👧👦*👨👨👧👦' ,
223
+ ) ;
216
224
} ) ;
217
225
it ( 'len,end' , ( ) => {
218
226
expect ( hideString ( 'helloworld' ) ) . toBe ( '**********' ) ;
@@ -225,6 +233,8 @@ describe('string', function () {
225
233
226
234
expect ( hideString ( '👨👨👧👦helloworld👨👨👧👦' , { len : 10 , end : - 1 } ) ) . toBe ( '👨👨👧👦**********👨👨👧👦' ) ;
227
235
expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { len : 11 , end : - 1 } ) ) . toBe ( '👨👨👧👦***********👨👨👧👦' ) ;
236
+
237
+ expect ( hideString ( '👨👨👧👦hello👨👨👧world👨👨👧👦' , { len : 11 , end : - 1 , replacementLen : 1 } ) ) . toBe ( '👨👨👧👦*👨👨👧👦' ) ;
228
238
} ) ;
229
239
} ) ;
230
240
test ( 'getClassNames' , ( ) => {
0 commit comments