gt

说明

检查x是否大于y

源码

用法

gt.test.ts
1
import { gt } from "../../utility/others/gt";
2
3
describe('gt tests: ', () => {
4
5
test('gt should return `true` when the param 1 that large than param2', () => {
6
const received = [10, 5];
7
const expected = true;
8
9
const result = gt(received[0], received[1]);
10
11
expect(result).toBe(expected);
12
});
13
14
test('gt should return `false` when the param 1 that equal with param2', () => {
15
const received = [10, 10];
16
const expected = false;
17
18
const result = gt(received[0], received[1]);
19
20
expect(result).toBe(expected);
21
});
22
23
test('gt should return `false` when the param 1 that small than param2', () => {
24
const received = [10, 20];
25
const expected = false;
26
27
const result = gt(received[0], received[1]);
28
29
expect(result).toBe(expected);
30
});
31
32
});
Copied!
最近更新 1yr ago
复制链接