-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.ts
66 lines (51 loc) · 1.41 KB
/
index.test.ts
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { test } from '@kakang/unit'
import { Array, isArray, isBigInt, isBoolean, isDate, isEmail, isEmpty, isExist, isJSON, isNull, isNumber, isObject, isString, isSymbol, isUndefined } from '../lib'
test('index', async function (t) {
t.test('Array', async function (t) {
t.test('isArray', function (t) {
t.equal(Array.isArray([]), true)
})
})
t.test('isArray', function (t) {
t.equal(isArray([]), true)
})
t.test('isDate', function (t) {
t.equal(isDate(new Date()), true)
})
t.test('isJSON', function (t) {
t.equal(isJSON({}), true)
})
t.test('isBigInt', function (t) {
t.equal(isBigInt(BigInt(0)), true)
})
t.test('isBoolean', function (t) {
t.equal(isBoolean(true), true)
})
t.test('isNull', function (t) {
t.equal(isNull(null), true)
})
t.test('isNumber', function (t) {
t.equal(isNumber(0), true)
})
t.test('isObject', function (t) {
t.equal(isObject({}), true)
})
t.test('isString', function (t) {
t.equal(isString(''), true)
})
t.test('isSymbol', function (t) {
t.equal(isSymbol(Symbol('')), true)
})
t.test('isUndefined', function (t) {
t.equal(isUndefined(undefined), true)
})
t.test('isExist', function (t) {
t.equal(isExist('abc'), true)
})
t.test('isEmpty', function (t) {
t.equal(isEmpty(null), true)
})
t.test('isEmail', function (t) {
t.equal(isEmail('[email protected]'), true)
})
})