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

tapAsync.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
import { delay } from './delay.js'import { pipedAsync } from './pipedAsync.js'import { tapAsync } from './tapAsync.js'
test('happy', async () => { const result = await tapAsync(delay, 1) expect(result).toBe(1)})
test('complex', async () => { let marker = false const fn = () => marker = true const result = await pipedAsync( 1, async x => { await delay(100)
return x + 1 }, tapAsync(fn), x => x + 1 ) expect(marker).toBeTrue() expect(result).toBe(3)})
rambda

Version Info

Tagged at
2 months ago