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

nextIndex.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { nextIndex } from './nextIndex.js'
const list = [ 1, 2, 3, 4 ]
test('happy path', () => { expect(nextIndex(2, list)).toBe(3)})
test('go back to the start', () => { expect(nextIndex(3, list)).toBe(0)})
test('current index is too big', () => { expect(nextIndex(32, list)).toBe(0)})
rambda

Version Info

Tagged at
2 months ago