Skip to content

Commit

Permalink
feat: add unit tests for toLowerCase utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranwv committed Jan 7, 2025
1 parent 1670bc9 commit d5ce499
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/format.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest'
import { toLowerCase } from '../src/format'

describe('toLowerCase', () => {
it('should convert camelCase to hyphen-case', () => {
expect(toLowerCase('camelCase')).toBe('camel-case')
})

it('should convert PascalCase to hyphen-case', () => {
expect(toLowerCase('PascalCase')).toBe('pascal-case')
})

it('should handle strings with spaces', () => {
expect(toLowerCase('Hello World')).toBe('hello-world')
})

it('should handle empty strings', () => {
expect(toLowerCase('')).toBe('')
})
})

0 comments on commit d5ce499

Please sign in to comment.