mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
10 lines
286 B
JavaScript
10 lines
286 B
JavaScript
import replace from '../src/replace';
|
|
|
|
describe('replace', () => {
|
|
it('should replace the matched pattern', () => {
|
|
const string = 'abcde';
|
|
expect(replace(string, 'de', '123')).toBe('abc123');
|
|
expect(replace(string, /[bd]/g, '-')).toBe('a-c-e');
|
|
});
|
|
});
|