@@ -395,7 +395,7 @@ describe('TypescriptParser', () => {
395395 } ) ;
396396
397397 it ( 'should parse a file' , ( ) => {
398- expect ( parsed . declarations ) . toHaveLength ( 4 ) ;
398+ expect ( parsed . declarations ) . toHaveLength ( 6 ) ;
399399 } ) ;
400400
401401 it ( 'should parse a non exported interface' , ( ) => {
@@ -436,6 +436,18 @@ describe('TypescriptParser', () => {
436436 expect ( parsedInterface . typeParameters ) . toContain ( 'TError' ) ;
437437 } ) ;
438438
439+ it ( 'should parse optional properties' , ( ) => {
440+ const parsedInterface = parsed . declarations [ 4 ] as InterfaceDeclaration ;
441+
442+ expect ( parsedInterface . properties ) . toMatchSnapshot ( ) ;
443+ } ) ;
444+
445+ it ( 'should parse optional functions' , ( ) => {
446+ const parsedInterface = parsed . declarations [ 5 ] as InterfaceDeclaration ;
447+
448+ expect ( parsedInterface ) . toMatchSnapshot ( ) ;
449+ } ) ;
450+
439451 } ) ;
440452
441453 describe ( 'Classes' , ( ) => {
@@ -448,7 +460,7 @@ describe('TypescriptParser', () => {
448460 } ) ;
449461
450462 it ( 'should parse a file' , ( ) => {
451- expect ( parsed . declarations ) . toHaveLength ( 8 ) ;
463+ expect ( parsed . declarations ) . toHaveLength ( 9 ) ;
452464 } ) ;
453465
454466 it ( 'should parse an abstract class' , ( ) => {
@@ -529,6 +541,12 @@ describe('TypescriptParser', () => {
529541 expect ( parsedClass . ctor ) . toMatchSnapshot ( ) ;
530542 } ) ;
531543
544+ it ( 'should parse optional class properties' , ( ) => {
545+ const parsedClass = parsed . declarations [ 8 ] as ClassDeclaration ;
546+
547+ expect ( parsedClass . properties ) . toMatchSnapshot ( ) ;
548+ } ) ;
549+
532550 } ) ;
533551
534552 describe ( 'Modules' , ( ) => {
0 commit comments