Files
lodash/test/replace.spec.ts
2023-09-16 14:47:50 -07:00

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');
});
});