-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.ts
50 lines (42 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
41
42
43
44
45
46
47
48
49
50
import { ProblemDetails, ResponseEnvelopes } from "./index";
import { describe, expect, it } from "@jest/globals";
import {
createInstanceWithInferredTypes,
createProblemDetailFactory,
} from "./ProblemDetails/functions";
import { matchesProblemDetailSchema } from "./ProblemDetails/helpers";
import { createSuccessEnvelope } from "./ResponseEnvelopes/functions";
import {
matchesEnvelopeSchema,
matchesSuccessEnvelopeSchema,
} from "./ResponseEnvelopes/helpers";
describe("Library export tests", () => {
describe("ProblemDetails", () => {
it("Collection defined", () => {
expect(ProblemDetails).toBeDefined();
});
it("Check ProblemDetails.factory", () => {
expect(ProblemDetails.factory).toBe(createProblemDetailFactory);
});
it("Check ProblemDetails.isOne", () => {
expect(ProblemDetails.isOne).toBe(matchesProblemDetailSchema);
});
it("Check ProblemDetails.create", () => {
expect(ProblemDetails.create).toBe(createInstanceWithInferredTypes);
});
});
describe("ResponseEnvelopes", () => {
it("Collection defined", () => {
expect(ResponseEnvelopes).toBeDefined();
});
it("Check ResponseEnvelopes.success", () => {
expect(ResponseEnvelopes.success).toBe(createSuccessEnvelope);
});
it("Check ResponseEnvelopes.isSuccess", () => {
expect(ResponseEnvelopes.isSuccess).toBe(matchesSuccessEnvelopeSchema);
});
it("Check ResponseEnvelopes.isOne", () => {
expect(ResponseEnvelopes.isOne).toBe(matchesEnvelopeSchema);
});
});
});