@@ -19,14 +19,14 @@ describe('Generate documentation', () => {
1919
2020 const noOpMethod = methods . find ( method => method . name === 'noOp' ) ;
2121 expect ( noOpMethod ) . toBeDefined ( ) ;
22- expect ( noOpMethod ?. returnType ) . toEqual ( { name : 'void' } ) ;
22+ expect ( noOpMethod ?. returnType ) . toEqual ( { name : 'void' , isNullable : false } ) ;
2323 expect ( noOpMethod ?. parameters ) . toEqual ( [ ] ) ;
2424 expect ( noOpMethod ?. description ) . toBeUndefined ( ) ;
2525 expect ( noOpMethod ?. inheritedFrom ) . toBeUndefined ( ) ;
2626
2727 const findStringMethod = methods . find ( method => method . name === 'findString' ) ;
2828 expect ( findStringMethod ) . toBeDefined ( ) ;
29- expect ( findStringMethod ?. returnType ) . toEqual ( { name : 'string' } ) ;
29+ expect ( findStringMethod ?. returnType ) . toEqual ( { name : 'string' , isNullable : false } ) ;
3030 expect ( findStringMethod ?. parameters ) . toEqual ( [ ] ) ;
3131 expect ( findStringMethod ?. description ) . toBe (
3232 'Finds a string.\n\nThe function may look trivial but people have been losing their words\nsince centuries.'
@@ -35,14 +35,14 @@ describe('Generate documentation', () => {
3535
3636 const setStringMethod = methods . find ( method => method . name === 'setString' ) ;
3737 expect ( setStringMethod ) . toBeDefined ( ) ;
38- expect ( setStringMethod ?. returnType ) . toEqual ( { name : 'void' } ) ;
38+ expect ( setStringMethod ?. returnType ) . toEqual ( { name : 'void' , isNullable : false } ) ;
3939 expect ( setStringMethod ?. parameters ) . toMatchSnapshot ( ) ;
4040 expect ( setStringMethod ?. description ) . toBe ( 'Short Text' ) ;
4141 expect ( setStringMethod ?. inheritedFrom ) . toBeUndefined ( ) ;
4242
4343 const findObjectMethod = methods . find ( method => method . name === 'findObject' ) ;
4444 expect ( findObjectMethod ) . toBeDefined ( ) ;
45- expect ( findObjectMethod ?. returnType ) . toEqual ( { name : 'TestReturnType' } ) ;
45+ expect ( findObjectMethod ?. returnType ) . toEqual ( { name : 'TestReturnType' , isNullable : false } ) ;
4646 expect ( findObjectMethod ?. parameters ) . toEqual ( [ ] ) ;
4747 expect ( findObjectMethod ?. description ) . toBe ( 'Short Text.\n\nLong Text.' ) ;
4848 expect ( findObjectMethod ?. inheritedFrom ) . toBeUndefined ( ) ;
@@ -57,7 +57,7 @@ describe('Generate documentation', () => {
5757 expect ( classDoc . name ) . toBe ( 'TestUtilWrapper' ) ;
5858
5959 const methods = classDoc . methods ;
60- expect ( methods . length ) . toBe ( 4 ) ;
60+ expect ( methods . length ) . toBe ( 5 ) ;
6161 expect ( methods ) . toMatchSnapshot ( ) ;
6262 } ) ;
6363
@@ -85,11 +85,13 @@ describe('Generate documentation', () => {
8585
8686 test ( 'deal with re-exports' , ( ) => {
8787 const results = buildTestUtilsProject ( 'exports' ) ;
88- expect ( results . map ( classDoc => classDoc . name ) ) . toEqual ( [ 'AlertWrapper' , 'ButtonWrapper' ] ) ;
88+ expect ( results . map ( classDoc => classDoc . name ) ) . toEqual ( [ 'AlertWrapper' , 'ButtonWrapper' , 'CardsWrapper' ] ) ;
8989 const alertWrapper = results . find ( classDoc => classDoc . name === 'AlertWrapper' ) ! ;
9090 expect ( alertWrapper . methods . map ( method => method . name ) ) . toEqual ( [ 'findContent' ] ) ;
9191 const buttonWrapper = results . find ( classDoc => classDoc . name === 'ButtonWrapper' ) ! ;
9292 expect ( buttonWrapper . methods . map ( method => method . name ) ) . toEqual ( [ 'findText' ] ) ;
93+ const cardsWrapper = results . find ( classDoc => classDoc . name === 'CardsWrapper' ) ! ;
94+ expect ( cardsWrapper . methods . map ( method => method . name ) ) . toEqual ( [ 'findItems' ] ) ;
9395 } ) ;
9496
9597 test ( 'default value rendering' , ( ) => {
@@ -110,7 +112,7 @@ describe('Generate documentation', () => {
110112 defaultValue : "'first'" ,
111113 } ,
112114 ] ,
113- returnType : { name : 'void' } ,
115+ returnType : { name : 'void' , isNullable : false } ,
114116 } ,
115117 {
116118 name : 'openDropdown' ,
@@ -122,7 +124,7 @@ describe('Generate documentation', () => {
122124 defaultValue : 'false' ,
123125 } ,
124126 ] ,
125- returnType : { name : 'void' } ,
127+ returnType : { name : 'void' , isNullable : false } ,
126128 } ,
127129 {
128130 name : 'selectOption' ,
@@ -134,7 +136,7 @@ describe('Generate documentation', () => {
134136 defaultValue : '1' ,
135137 } ,
136138 ] ,
137- returnType : { name : 'void' } ,
139+ returnType : { name : 'void' , isNullable : false } ,
138140 } ,
139141 ] ) ;
140142 } ) ;
0 commit comments