1+ import { dashToCamelCase } from "./dashToCamelCase" ;
2+
3+ describe ( "dashToCamelCase" , ( ) => {
4+ it ( "should convert a dash-case string to camelCase" , ( ) => {
5+ const input = "hello-world" ;
6+ const expectedOutput = "helloWorld" ;
7+ const result = dashToCamelCase ( input ) ;
8+ expect ( result ) . toBe ( expectedOutput ) ;
9+ } ) ;
10+
11+ it ( "should convert a single character dash-case string to camelCase" , ( ) => {
12+ const input = "a-b-c" ;
13+ const expectedOutput = "aBC" ;
14+ const result = dashToCamelCase ( input ) ;
15+ expect ( result ) . toBe ( expectedOutput ) ;
16+ } ) ;
17+
18+ it ( "should convert a dash-case string with multiple dashes to camelCase" , ( ) => {
19+ const input = "this-is-a-test" ;
20+ const expectedOutput = "thisIsATest" ;
21+ const result = dashToCamelCase ( input ) ;
22+ expect ( result ) . toBe ( expectedOutput ) ;
23+ } ) ;
24+
25+ it ( "should convert a dash-case string with leading and trailing dashes to camelCase" , ( ) => {
26+ const input = "-hello-world-" ;
27+ const expectedOutput = "helloWorld" ;
28+ const result = dashToCamelCase ( input ) ;
29+ expect ( result ) . toBe ( expectedOutput ) ;
30+ } ) ;
31+
32+ it ( "should convert an empty string to an empty camelCase string" , ( ) => {
33+ const input = "" ;
34+ const expectedOutput = "" ;
35+ const result = dashToCamelCase ( input ) ;
36+ expect ( result ) . toBe ( expectedOutput ) ;
37+ } ) ;
38+ } ) ;
0 commit comments