UNPKG

@ryusei/code

Version:

<div align="center"> <a href="https://code.ryuseijs.com"> <img alt="RyuseiCode" src="https://code.ryuseijs.com/images/svg/logo.svg" width="70"> </a>

15 lines (10 loc) 438 B
import { startsWith } from './startsWith'; describe( 'startsWidth', () => { const string = '0123456789'; test( 'can check if the string starts with the search string or not.', () => { expect( startsWith( string, '012' ) ).toBe( true ); expect( startsWith( string, '345' ) ).toBe( false ); expect( startsWith( string, string ) ).toBe( true ); expect( startsWith( string, string + 'a' ) ).toBe( false ); } ); } );