-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bool.test.ts
48 lines (37 loc) · 1.14 KB
/
bool.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
import { describe, expect, it } from "@jest/globals";
import fc from "fast-check";
import type { All, Any, Bool } from "../src/bool.js";
import { all, any, bool } from "./arbitraries.js";
const boolToStringDefinition = (m: Bool): void => {
expect(m.toString()).toStrictEqual(`Bool(${m.value})`);
};
const anyToStringDefinition = (m: Any): void => {
expect(m.toString()).toStrictEqual(`Any(${m.value})`);
};
const allToStringDefinition = (m: All): void => {
expect(m.toString()).toStrictEqual(`All(${m.value})`);
};
describe("Bool", () => {
describe("toString", () => {
it("should convert Bool to a string", () => {
expect.assertions(100);
fc.assert(fc.property(bool, boolToStringDefinition));
});
});
});
describe("Any", () => {
describe("toString", () => {
it("should convert Any to a string", () => {
expect.assertions(100);
fc.assert(fc.property(any, anyToStringDefinition));
});
});
});
describe("All", () => {
describe("toString", () => {
it("should convert All to a string", () => {
expect.assertions(100);
fc.assert(fc.property(all, allToStringDefinition));
});
});
});