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

removeIndex.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { removeIndex } from './removeIndex.js'
const list = [ 1, 2, 3, 4 ]
test('first or before first index', () => { expect(removeIndex(-2, list)).toEqual([ 2, 3, 4 ]) expect(removeIndex(-2)(list)).toEqual([ 2, 3, 4 ])})
test('last or after last index', () => { expect(removeIndex(4, list)).toEqual([ 1, 2, 3 ]) expect(removeIndex(10, list)).toEqual([ 1, 2, 3 ])})
test('middle index', () => { expect(removeIndex(1, list)).toEqual([ 1, 3, 4 ]) expect(removeIndex(2, list)).toEqual([ 1, 2, 4 ])})
rambda

Version Info

Tagged at
2 months ago