-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.ts
49 lines (41 loc) · 832 Bytes
/
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
import func from "../src/index";
import func2 from "../src/index2";
import func3 from "../src/index3";
import {
ternary,
defaultArg,
binaryExp,
complexBinaryExp,
nestBinaryExp,
} from "../src/other_types";
import { it } from "mocha";
it("index", () => {
func(true);
func(false);
});
it("index2", () => {
func2(true);
func2(false);
});
it("index3", () => {
func3(1);
});
it("other types", () => {
// ternary operator type: cond-expr
ternary(1);
ternary(-1);
// default arguments type: default-arg
defaultArg();
defaultArg(1);
// binary expression type: binary-expr
binaryExp(1);
binaryExp(5);
// complex binary expression
complexBinaryExp(1);
complexBinaryExp(5);
complexBinaryExp(12);
// nest binary expression
nestBinaryExp(1);
nestBinaryExp(5);
nestBinaryExp(12);
});