mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
renaming the function for clarity
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
export function toUppercase(input: string): string {
|
export function UppercaseInput(input: string): string {
|
||||||
return input.toUpperCase();
|
return input.toUpperCase();
|
||||||
}
|
}
|
@@ -1,34 +1,34 @@
|
|||||||
import { expect, describe, it } from 'vitest';
|
import { expect, describe, it } from 'vitest';
|
||||||
import { toUppercase } from './service';
|
import { UppercaseInput } from './service';
|
||||||
|
|
||||||
describe('toUppercase', () => {
|
describe('UppercaseInput', () => {
|
||||||
test('should convert a lowercase string to uppercase', () => {
|
it('should convert a lowercase string to uppercase', () => {
|
||||||
const input = 'hello';
|
const input = 'hello';
|
||||||
const result = toUppercase(input);
|
const result = UppercaseInput(input);
|
||||||
expect(result).toBe('HELLO');
|
expect(result).toBe('HELLO');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should convert a mixed case string to uppercase', () => {
|
it('should convert a mixed case string to uppercase', () => {
|
||||||
const input = 'HeLLo WoRLd';
|
const input = 'HeLLo WoRLd';
|
||||||
const result = toUppercase(input);
|
const result = UppercaseInput(input);
|
||||||
expect(result).toBe('HELLO WORLD');
|
expect(result).toBe('HELLO WORLD');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should convert an already uppercase string to uppercase', () => {
|
it('should convert an already uppercase string to uppercase', () => {
|
||||||
const input = 'HELLO';
|
const input = 'HELLO';
|
||||||
const result = toUppercase(input);
|
const result = UppercaseInput(input);
|
||||||
expect(result).toBe('HELLO');
|
expect(result).toBe('HELLO');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should handle an empty string', () => {
|
it('should handle an empty string', () => {
|
||||||
const input = '';
|
const input = '';
|
||||||
const result = toUppercase(input);
|
const result = UppercaseInput(input);
|
||||||
expect(result).toBe('');
|
expect(result).toBe('');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should handle a string with numbers and symbols', () => {
|
it('should handle a string with numbers and symbols', () => {
|
||||||
const input = '123 hello! @world';
|
const input = '123 hello! @world';
|
||||||
const result = toUppercase(input);
|
const result = UppercaseInput(input);
|
||||||
expect(result).toBe('123 HELLO! @WORLD');
|
expect(result).toBe('123 HELLO! @WORLD');
|
||||||
});
|
});
|
||||||
});
|
});
|
Reference in New Issue
Block a user