-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
types.js
28 lines (24 loc) 路 843 Bytes
/
types.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
26
27
28
const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe;
describeSkipPublish("token types", () => {
let tt, tokenOperatorPrecedence;
beforeAll(async () => {
({ tt, tokenOperatorPrecedence } = await import(
"../../../lib/tokenizer/types.js"
));
});
it("should check if the binOp for relational === in", () => {
expect(tokenOperatorPrecedence(tt.relational)).toEqual(
tokenOperatorPrecedence(tt._in),
);
});
it("should check if the binOp for relational === instanceOf", () => {
expect(tokenOperatorPrecedence(tt.relational)).toEqual(
tokenOperatorPrecedence(tt._instanceof),
);
});
it("should check if the binOp for in === instanceOf", () => {
expect(tokenOperatorPrecedence(tt._in)).toEqual(
tokenOperatorPrecedence(tt._instanceof),
);
});
});