-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.test.ts
40 lines (35 loc) · 1.52 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
import { describe, it, expect } from "vitest";
import Kudo from "./";
describe("Entry", () => {
it("should have correct toString representation", () => {
expect(Kudo.toString()).toBe("[object Object]");
});
it("should expose helper functions", () => {
expect(typeof Kudo.id).toBe("function");
expect(typeof Kudo.once).toBe("function");
expect(typeof Kudo.fmap).toBe("function");
expect(typeof Kudo.bimap).toBe("function");
expect(typeof Kudo.chain).toBe("function");
expect(typeof Kudo.caseOf).toBe("function");
expect(typeof Kudo.curry).toBe("function");
expect(typeof Kudo.ocurry).toBe("function");
expect(typeof Kudo.compose).toBe("function");
expect(typeof Kudo.constant).toBe("function");
expect(typeof Kudo.liftAn).toBe("function");
expect(typeof Kudo.liftA2).toBe("function");
expect(typeof Kudo.liftA3).toBe("function");
});
it("should expose conversion functions", () => {
expect(typeof Kudo.maybeToEither).toBe("function");
expect(typeof Kudo.eitherToMaybe).toBe("function");
expect(typeof Kudo.prop).toBe("function");
});
it("should expose ADTs", () => {
expect(typeof Kudo.Either).toBe("function");
expect(typeof Kudo.Maybe).toBe("function");
expect(typeof Kudo.Task).toBe("function");
expect(typeof Kudo.Pair).toBe("function");
expect(typeof Kudo.Reader).toBe("function");
expect(typeof Kudo.State).toBe("function");
});
});