2022-11-25 20:25:03 +00:00
|
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
|
2022-06-26 18:34:09 +00:00
|
|
|
import { capitalize } from '@/lib/strings';
|
|
|
|
|
2022-11-25 20:25:03 +00:00
|
|
|
describe('@/lib/strings.ts', () => {
|
|
|
|
describe('capitalize()', () => {
|
|
|
|
it('should capitalize a string', () => {
|
|
|
|
expect(capitalize('foo bar')).equals('Foo bar');
|
|
|
|
expect(capitalize('FOOBAR')).equals('Foobar');
|
2022-06-26 18:34:09 +00:00
|
|
|
});
|
|
|
|
|
2022-11-25 20:25:03 +00:00
|
|
|
it('should handle empty strings', () => {
|
|
|
|
expect(capitalize('')).equals('');
|
2022-06-26 18:34:09 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|