mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
11 lines
334 B
TypeScript
11 lines
334 B
TypeScript
import assert from 'node:assert';
|
|
import replace from '../src/replace';
|
|
|
|
describe('replace', () => {
|
|
it('should replace the matched pattern', () => {
|
|
const string = 'abcde';
|
|
assert.strictEqual(replace(string, 'de', '123'), 'abc123');
|
|
assert.strictEqual(replace(string, /[bd]/g, '-'), 'a-c-e');
|
|
});
|
|
});
|