Skip to content

Commit c76538b

Browse files
committed
test: cleanup
1 parent ac3a897 commit c76538b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/utils/getSchemaType.test.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { compileSchema } from "../compileSchema";
22
import { getSchemaType } from "./getSchemaType";
33
import { strict as assert } from "assert";
44

5-
describe("issue#90 - types or refs", () => {
5+
describe("getSchemaType", () => {
66
it("should get correct type for simple ref", () => {
77
const schema = compileSchema({
88
type: "object",
@@ -17,7 +17,8 @@ describe("issue#90 - types or refs", () => {
1717
});
1818
const nameProp = schema.getNodeChild("name").node;
1919
assert(nameProp != null);
20-
assert(getSchemaType(nameProp, undefined) === "string");
20+
21+
assert.equal(getSchemaType(nameProp, undefined), "string");
2122
});
2223

2324
it("should handle oneOf refs", () => {
@@ -42,7 +43,8 @@ describe("issue#90 - types or refs", () => {
4243
});
4344
const oneOfProp = schema.getNodeChild("oneOf").node;
4445
assert(oneOfProp != null);
45-
assert(getSchemaType(oneOfProp, undefined) === "string");
46+
47+
assert.equal(getSchemaType(oneOfProp, undefined), "string");
4648
});
4749
it("should handle anyOf refs", () => {
4850
const schema = compileSchema({
@@ -59,8 +61,10 @@ describe("issue#90 - types or refs", () => {
5961
});
6062
const anyOfProp = schema.getNodeChild("anyOf").node;
6163
assert(anyOfProp != null);
62-
assert(getSchemaType(anyOfProp, undefined) === "string");
64+
65+
assert.equal(getSchemaType(anyOfProp, undefined), "string");
6366
});
67+
6468
it("should handle allOf refs", () => {
6569
const schema = compileSchema({
6670
type: "object",
@@ -76,8 +80,10 @@ describe("issue#90 - types or refs", () => {
7680
});
7781
const allOfProp = schema.getNodeChild("allOf").node;
7882
assert(allOfProp != null);
79-
assert(getSchemaType(allOfProp, undefined) === "object");
83+
84+
assert.equal(getSchemaType(allOfProp, undefined), "object");
8085
});
86+
8187
it("should handle if/then/else refs", () => {
8288
const schema = compileSchema({
8389
type: "object",
@@ -96,6 +102,7 @@ describe("issue#90 - types or refs", () => {
96102
});
97103
const conditionalProp = schema.getNodeChild("conditional").node;
98104
assert(conditionalProp != null);
99-
assert(getSchemaType(conditionalProp, undefined) === "string");
105+
106+
assert.equal(getSchemaType(conditionalProp, undefined), "string");
100107
});
101108
});

0 commit comments

Comments
 (0)