Skip to main content
Module

x/rambda/repeat.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { repeat } from './repeat'
test('repeat', () => { expect(repeat('')(3)).toEqual([ '', '', '' ]) expect(repeat('foo', 3)).toEqual([ 'foo', 'foo', 'foo' ])
const obj = {} const arr = repeat(obj, 3)
expect(arr).toEqual([ {}, {}, {} ])
expect(arr[ 0 ] === arr[ 1 ]).toBeTrue()})