|
1 | | -const testData = require('./isodate.ct') |
| 1 | +const testData = require("./isodate.ct"); |
2 | 2 |
|
3 | | -import NullDocumentationGenerator from '../../src/lib/tsgen/docgen/nulldoc' |
4 | | -import tsgenFactory from '../../src/lib/tsgen/factory' |
| 3 | +import NullDocumentationGenerator from "../../src/lib/tsgen/docgen/nulldoc"; |
| 4 | +import tsgenFactory from "../../src/lib/tsgen/factory"; |
5 | 5 |
|
6 | 6 | const tsgen = tsgenFactory({ |
7 | 7 | docgen: new NullDocumentationGenerator(), |
8 | | -}) |
| 8 | +}); |
9 | 9 |
|
10 | | -describe('builtin isodate field', () => { |
11 | | - const result = tsgen(testData.builtinIsodate) |
| 10 | +describe("builtin isodate field", () => { |
| 11 | + const result = tsgen(testData.builtinIsodate); |
12 | 12 |
|
13 | 13 | /* |
14 | 14 | * Isodates are returned as strings |
15 | 15 | */ |
16 | | - test('metadata', () => { |
17 | | - const types = result.metadata.types |
18 | | - expect([...types.contentstack]).toHaveLength(0) |
19 | | - expect([...types.globalFields]).toHaveLength(0) |
20 | | - expect(types.javascript).toContain('string') |
21 | | - }) |
| 16 | + test("metadata", () => { |
| 17 | + const types = result.metadata.types; |
| 18 | + expect([...types.contentstack]).toHaveLength(0); |
| 19 | + expect([...types.globalFields]).toHaveLength(0); |
| 20 | + expect(types.javascript).toContain("string"); |
| 21 | + }); |
22 | 22 |
|
23 | | - test('definition', () => { |
| 23 | + test("definition", () => { |
24 | 24 | expect(result.definition).toMatchInlineSnapshot(` |
25 | 25 | "export interface Isodate |
26 | 26 | { |
27 | 27 | /** Version */ |
28 | 28 | version: 2 ; |
29 | | - title: string; |
30 | | - date?: string; |
31 | | - date_required: string; |
32 | | - date_multiple?: string[]; |
33 | | - date_multiple_maxlength?: [string, string, string, string, string]; |
34 | | - date_required_multiple_maxlength: [string, string, string, string, string, string, string, string]; |
| 29 | + title: string ; |
| 30 | + date?: string | null ; |
| 31 | + date_required: string ; |
| 32 | + date_multiple?: string[] | null ; |
| 33 | + date_multiple_maxlength?: [string, string, string, string, string] | null ; |
| 34 | + date_required_multiple_maxlength: [string, string, string, string, string, string, string, string] ; |
35 | 35 | }" |
36 | | - `) |
37 | | - }) |
38 | | -}) |
| 36 | + `); |
| 37 | + }); |
| 38 | +}); |
0 commit comments