string-replace-all
Version:
Replaces all the occurrences of a string into a string with another string.
20 lines (10 loc) • 324 B
JavaScript
/* IMPORT */
import {describe} from 'fava';
import stringReplaceAll from '../dist/index.js';
/* MAIN */
describe ( 'stringReplaceAll', it => {
it ( 'Replaces all the occurrences', t => {
const str = 'A tiny tiny tiger';
t.is ( stringReplaceAll ( str, 'tiny', 'small' ), 'A small small tiger' );
});
});