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

isType.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
import { delay } from './delay.js'import { isType } from './isType.js'
const list = [ 1, 2, 3 ]
test('array', () => { expect(isType('Array', list)).toBeTruthy() expect(isType('Array')([])).toBeTruthy()})
test('promise', () => { expect(isType('Promise', Promise.resolve(1))).toBeTruthy()})
test('async', () => { async function fn(){}
expect(isType('Promise', fn)).toBeTruthy()})
test('with R.delay', () => { expect(isType('Function', delay)).toBeTruthy() expect(isType('Promise', delay(100))).toBeTruthy()})
rambda

Version Info

Tagged at
2 months ago