misc_pterodactyl-panel/resources/scripts/lib/strings.spec.ts

17 lines
470 B
TypeScript
Raw Normal View History

2022-11-25 20:25:03 +00:00
import { describe, expect, it } from 'vitest';
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-11-25 20:25:03 +00:00
it('should handle empty strings', () => {
expect(capitalize('')).equals('');
});
});
});