Skip to main content
Module

x/rambda/replace.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { replace } from './replace'
test('happy', () => { expect(replace( 'foo', 'yes', 'foo bar baz' )).toEqual('yes bar baz')})
test('1', () => { expect(replace(/\s/g)('|')('foo bar baz')).toEqual('foo|bar|baz')})
test('2', () => { expect(replace(/\s/g)('|', 'foo bar baz')).toEqual('foo|bar|baz')})
test('3', () => { expect(replace(/\s/g, '|')('foo bar baz')).toEqual('foo|bar|baz')})