Skip to content

Commit e8de39a

Browse files
committed
test cases fix and removing stray console logs
1 parent 5062c55 commit e8de39a

10 files changed

Lines changed: 32 additions & 34 deletions

src/lib/tsgen/factory.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ export default function (userOptions: TSGenOptions) {
216216
fieldType += "[]";
217217
}
218218
}
219-
console.log(field.data_type)
220-
console.log(['isodate','file','number'].includes(field.data_type))
221219
return [
222220
field.uid + op_required(field.mandatory) + ':',
223221
fieldType || visit_field_type(field), (['isodate','file','number'].includes(field.data_type) || ['radio','dropdown'].includes(field.display_type))?field.mandatory?'':'| null':'', ';'

tests/tsgen/boolean.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe("builtin boolean field", () => {
2727
/** Version */
2828
version: 2 ;
2929
title: string ;
30-
boolean?: boolean | null ;
30+
boolean?: boolean ;
3131
}"
3232
`);
3333
});

tests/tsgen/global.fields.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe("global fields", () => {
2626
{
2727
/** Version */
2828
version: ;
29-
keywords?: string | null ;
30-
description?: string | null ;
29+
keywords?: string ;
30+
description?: string ;
3131
}"
3232
`);
3333
});
@@ -39,7 +39,7 @@ describe("global fields", () => {
3939
/** Version */
4040
version: 2 ;
4141
title: string ;
42-
seo?: ISeo | null ;
42+
seo?: ISeo ;
4343
}"
4444
`);
4545
});

tests/tsgen/group.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ describe("group", () => {
3636
number?: number | null ;
3737
}, {
3838
number?: number | null ;
39-
}] | null ;
39+
}] ;
4040
multiple_group?: {
41-
single_line?: string | null ;
42-
}[] | null ;
41+
single_line?: string ;
42+
}[] ;
4343
parent_group?: {
44-
rich_text_editor?: string | null ;
45-
multi_line?: string | null ;
46-
single_line?: string | null ;
44+
rich_text_editor?: string ;
45+
multi_line?: string ;
46+
single_line?: string ;
4747
child_group?: {
4848
number?: number | null ;
49-
boolean?: boolean | null ;
49+
boolean?: boolean ;
5050
date?: string | null ;
51-
} | null ;
52-
} | null ;
51+
} ;
52+
} ;
5353
}"
5454
`);
5555
});

tests/tsgen/jsdoc.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ describe("jsdoc", () => {
2222
/** Age */
2323
current_age?: number | null ;
2424
/** City */
25-
current_city?: string | null ;
25+
current_city?: string ;
2626
/** State */
27-
current_state?: string | null ;
27+
current_state?: string ;
2828
}"
2929
`);
3030
});

tests/tsgen/modular.blocks.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ describe("modular blocks", () => {
2424
version: 2 ;
2525
title: string ;
2626
url: string ;
27-
modular_blocks?: ({string_block: {single_line?: string | null ;
28-
multi_line?: string | null ;
29-
markdown?: string | null ;
30-
rich_text_editor?: string | null ;};string_block_with_options: undefined;
27+
modular_blocks?: ({string_block: {single_line?: string ;
28+
multi_line?: string ;
29+
markdown?: string ;
30+
rich_text_editor?: string ;};string_block_with_options: undefined;
3131
boolean_block: undefined;} | {string_block_with_options: {single_line_textbox_required: string ;
32-
single_line_textbox_multiple?: string[] | null ;};string_block: undefined;
33-
boolean_block: undefined;} | {boolean_block: {boolean?: boolean | null ;};string_block: undefined;
34-
string_block_with_options: undefined;})[] | null ;
32+
single_line_textbox_multiple?: string[] ;};string_block: undefined;
33+
boolean_block: undefined;} | {boolean_block: {boolean?: boolean ;};string_block: undefined;
34+
string_block_with_options: undefined;})[] ;
3535
}"
3636
`);
3737
});

tests/tsgen/options.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ describe("all options", () => {
1818
version: 4 ;
1919
title: string ;
2020
url: string ;
21-
single_line_textbox_not_required?: string | null ;
21+
single_line_textbox_not_required?: string ;
2222
single_line_textbox_required: string ;
23-
single_line_textbox_multiple?: string[] | null ;
24-
single_line_textbox_multiple_max_limit?: [string, string, string, string, string] | null ;
23+
single_line_textbox_multiple?: string[] ;
24+
single_line_textbox_multiple_max_limit?: [string, string, string, string, string] ;
2525
}"
2626
`);
2727
});

tests/tsgen/references.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("references", () => {
3030
title: string ;
3131
url: string ;
3232
single_reference: (IReferenceChild) ;
33-
multiple_reference?: (IReferenceChild | IBoolean | IBuiltinExample)[] | null ;
33+
multiple_reference?: (IReferenceChild | IBoolean | IBuiltinExample)[] ;
3434
}"
3535
`);
3636
});

tests/tsgen/string.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ describe("builtin string fields", () => {
2424
/** Version */
2525
version: 4 ;
2626
title: string ;
27-
single_line?: string | null ;
28-
multi_line?: string | null ;
29-
rich_text_editor?: string | null ;
30-
markdown?: string | null ;
27+
single_line?: string ;
28+
multi_line?: string ;
29+
rich_text_editor?: string ;
30+
markdown?: string ;
3131
}"
3232
`);
3333
});

tests/tsgen/taxonomies.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ describe("builtin taxonomies field", () => {
2929
/** Version */
3030
version: 2 ;
3131
title: string ;
32-
boolean?: boolean | null ;
33-
taxonomies?: ITaxonomy[] | null ;
32+
boolean?: boolean ;
33+
taxonomies?: ITaxonomy[] ;
3434
}"
3535
`);
3636
});

0 commit comments

Comments
 (0)