feat: add pipe to upper only the first letter in a string

This commit is contained in:
2025-12-11 21:15:43 -03:00
parent 2f1de6bea3
commit bda4cb9136
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { UpperfirstPipe } from './upperfirst-pipe';
describe('UpperfirstPipe', () => {
let pipe: UpperfirstPipe;
beforeEach(() => {
pipe = new UpperfirstPipe();
});
it('create an instance', () => {
const pipe = new UpperfirstPipe();
expect(pipe).toBeTruthy();
});
it('should uppercase only the first letter on a string', () => {
const unformattedString = "today is a great day";
const expectedString = "Today is a great day";
expect(pipe.transform(unformattedString)).toBe(expectedString);
});
});