deno.land / x / rambda@v9.1.1 / source / splitEvery.spec.js

splitEvery.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { splitEvery } from './splitEvery.js'
test('happy', () => { expect(splitEvery(3, [ 1, 2, 3, 4, 5, 6, 7 ])).toEqual([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7 ], ])
expect(splitEvery(3)('foobarbaz')).toEqual([ 'foo', 'bar', 'baz' ])})
test('with bad input', () => { expect(() => expect(splitEvery(0)('foo')).toEqual([ 'f', 'o', 'o' ])).toThrowErrorMatchingInlineSnapshot('"First argument to splitEvery must be a positive integer"')})
rambda

Version Info

Tagged at
2 months ago