deno.land / x / rambda@v9.1.1 / source / times.spec.js
1234567891011121314151617181920212223242526import assert from 'assert'
import { identity } from './identity.js'import { times } from './times.js'
test('happy', () => { const result = times(identity, 5)
expect(result).toEqual([ 0, 1, 2, 3, 4 ])})
test('with bad input', () => { assert.throws(() => { times(3)('cheers!') }, RangeError) assert.throws(() => { times(identity, -1) }, RangeError)})
test('curry', () => { const result = times(identity)(5)
expect(result).toEqual([ 0, 1, 2, 3, 4 ])})
Version Info