Skip to content

Commit d5ce499

Browse files
committed
feat: add unit tests for toLowerCase utility function
1 parent 1670bc9 commit d5ce499

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/format.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { toLowerCase } from '../src/format'
3+
4+
describe('toLowerCase', () => {
5+
it('should convert camelCase to hyphen-case', () => {
6+
expect(toLowerCase('camelCase')).toBe('camel-case')
7+
})
8+
9+
it('should convert PascalCase to hyphen-case', () => {
10+
expect(toLowerCase('PascalCase')).toBe('pascal-case')
11+
})
12+
13+
it('should handle strings with spaces', () => {
14+
expect(toLowerCase('Hello World')).toBe('hello-world')
15+
})
16+
17+
it('should handle empty strings', () => {
18+
expect(toLowerCase('')).toBe('')
19+
})
20+
})

0 commit comments

Comments
 (0)