-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__tests__.ts
44 lines (33 loc) · 886 Bytes
/
__tests__.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
/*
* @Author: Rainy
* @Date: 2019-11-14 19:25:01
* @LastEditors: Rainy
* @LastEditTime: 2019-12-02 20:28:56
*/
import { _is } from '.';
test(`is('foo', 'foo') should be true`, () => {
expect(_is('foo', 'foo')).toBe(true);
});
test(`is([], []) should be false`, () => {
expect(_is([], [])).toBe(false);
});
const u1 = { name: 'Rain120' };
const u2 = { name: 'Rain120' };
test(`is(u1, u1) should be true`, () => {
expect(_is(u1, u1)).toBe(true);
});
test(`is(u1, u2) should be false`, () => {
expect(_is(u1, u2)).toBe(false);
});
test(`is(null, null) should be true`, () => {
expect(_is(null, null)).toBe(true);
});
test(`is(0, -0) should be false`, () => {
expect(_is(0, -0)).toBe(false);
});
test(`is(0, +0) should be true`, () => {
expect(_is(0, +0)).toBe(true);
});
test(`is(NaN, 0 / 0) should be true`, () => {
expect(_is(NaN, 0 / 0)).toBe(true);
});