forked from vega/ts-json-schema-generator
/
valid-data-annotations.test.ts
47 lines (38 loc) · 1.82 KB
/
valid-data-annotations.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
import { assertValidSchema } from "./utils";
describe("valid-data-annotations", () => {
it(
"annotation-custom",
assertValidSchema("annotation-custom", "MyObject", "basic", [
"customBooleanProperty",
"customNumberProperty",
"customStringProperty",
"customComplexProperty",
"customMultilineProperty",
"customUnquotedProperty",
])
);
it("annotation-empty-basic", assertValidSchema("annotation-empty", "MyObject", "basic", ["customEmptyAnnotation"]));
it(
"annotation-empty-extended",
assertValidSchema("annotation-empty", "MyObject", "extended", ["customEmptyAnnotation"])
);
it(
"annotation-deprecated-basic",
assertValidSchema("annotation-deprecated", "MyObject", "basic", ["deprecationMessage"])
);
it(
"annotation-deprecated-extended",
assertValidSchema("annotation-deprecated", "MyObject", "extended", ["deprecationMessage"])
);
it(
"annotation-description-override",
assertValidSchema("annotation-description-override", "MyObject", "extended", ["markdownDescription"])
);
it("annotation-comment", assertValidSchema("annotation-comment", "MyObject", "extended"));
it("annotation-example", assertValidSchema("annotation-example", "MyObject", "extended"));
it("annotation-id", assertValidSchema("annotation-id", "MyObject", "extended", [], "Test"));
it("annotation-readOnly", assertValidSchema("annotation-readOnly", "MyObject", "basic"));
it("annotation-ref", assertValidSchema("annotation-ref", "MyObject", "extended"));
it("annotation-writeOnly", assertValidSchema("annotation-writeOnly", "MyObject", "basic"));
it("annotation-union-if-then", assertValidSchema("annotation-union-if-then", "Animal", "basic"));
});