import { ReplaceAllPipe } from './replace-all.pipe'; describe('ReplaceAllPipe', () => { it('creates an instance', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); expect(pipe).toBeTruthy(); }); it('replaces "$" in a string with "."', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); const result: string = pipe.transform('testString$', '$', '.'); expect(result).toBe('testString.'); }); it('replaces "x" in a string with "xyz"', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); const result: string = pipe.transform('wxx', 'x', 'xyz'); expect(result).toBe('wxyzxyz'); }); it('replaces "aA" in a string with "bb"', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); const result: string = pipe.transform('aA', 'a', 'b', true); expect(result).toBe('bb'); }); it('replaces "???" in a string with "!!!!"', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); const result: string = pipe.transform('Hello???', '?', '!'); expect(result).toBe('Hello!!!'); }); it('replaces "4" in a string with "3"', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); const result: string = pipe.transform('124', '4', '3'); expect(result).toBe('123'); }); it('removes "." from ".ta-class"', () => { const pipe: ReplaceAllPipe = new ReplaceAllPipe(); const result: string = pipe.transform('.ta-class', '.', ''); expect(result).toBe('ta-class'); }); });