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

insertAll.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { insertAll } from './insertAll';
it('inserts a list of elements into the given list', () => { const list = ['a', 'b', 'c', 'd', 'e']; expect(insertAll(2, ['x', 'y', 'z'], list)).toEqual([ 'a', 'b', 'x', 'y', 'z', 'c', 'd', 'e', ]);});
it('appends to the end of the list if the index is too large', () => { const list = ['a', 'b', 'c', 'd', 'e']; expect(insertAll(8, ['p', 'q', 'r'], list)).toEqual([ 'a', 'b', 'c', 'd', 'e', 'p', 'q', 'r', ]);});
rambda

Version Info

Tagged at
2 months ago