@@ -284,6 +284,30 @@ test.each([
284284 expect ( result ) . toBe ( inp . charAt ( index ) ) ;
285285} ) ;
286286
287+ test . each < { inp : string ; args : Parameters < string [ "startsWith" ] > } > ( [
288+ { inp : "hello test" , args : [ "" ] } ,
289+ { inp : "hello test" , args : [ "hello" ] } ,
290+ { inp : "hello test" , args : [ "test" ] } ,
291+ { inp : "hello test" , args : [ "test" , 6 ] } ,
292+ ] ) ( "string.startsWith (%p)" , ( { inp, args } ) => {
293+ const argsString = args . map ( arg => JSON . stringify ( arg ) ) . join ( ", " ) ;
294+ const result = util . transpileAndExecute ( `return "${ inp } ".startsWith(${ argsString } )` ) ;
295+
296+ expect ( result ) . toBe ( inp . startsWith ( ...args ) ) ;
297+ } ) ;
298+
299+ test . each < { inp : string ; args : Parameters < string [ "endsWith" ] > } > ( [
300+ { inp : "hello test" , args : [ "" ] } ,
301+ { inp : "hello test" , args : [ "test" ] } ,
302+ { inp : "hello test" , args : [ "hello" ] } ,
303+ { inp : "hello test" , args : [ "hello" , 5 ] } ,
304+ ] ) ( "string.endsWith (%p)" , ( { inp, args } ) => {
305+ const argsString = args . map ( arg => JSON . stringify ( arg ) ) . join ( ", " ) ;
306+ const result = util . transpileAndExecute ( `return "${ inp } ".endsWith(${ argsString } )` ) ;
307+
308+ expect ( result ) . toBe ( inp . endsWith ( ...args ) ) ;
309+ } ) ;
310+
287311test . each ( [
288312 { input : "abcd" , index : 3 } ,
289313 { input : "abcde" , index : 3 } ,
0 commit comments