@@ -124,6 +124,153 @@ describe('parseSignatures', () => {
124124 } ) ;
125125 } ) ;
126126
127+ test ( '`something.regexExtractedReturnType()`' , ( ) => {
128+ /**
129+ * ### `something.regexExtractedReturnType()`
130+ *
131+ * * this line should be ignored
132+ * * Returns: {integer} something something something
133+ */
134+
135+ /**
136+ * @type {import('../../../../../utils/buildHierarchy.mjs').HierarchizedEntry }
137+ */
138+ const entry = {
139+ heading : {
140+ data : {
141+ type : 'classMethod' ,
142+ text : '`something.regexExtractedReturnType()`' ,
143+ } ,
144+ } ,
145+ content : {
146+ type : 'root' ,
147+ children : [
148+ undefined , // this should be ignore
149+ {
150+ type : 'list' ,
151+ children : [
152+ {
153+ type : 'listItem' ,
154+ children : [
155+ {
156+ type : 'paragraph' ,
157+ children : [
158+ {
159+ type : 'text' ,
160+ value : 'this line should be ignored' ,
161+ } ,
162+ ] ,
163+ } ,
164+ ] ,
165+ } ,
166+ {
167+ type : 'listItem' ,
168+ children : [
169+ {
170+ type : 'paragraph' ,
171+ children : [
172+ {
173+ type : 'text' ,
174+ value :
175+ 'Returns: {integer} something something something' ,
176+ } ,
177+ ] ,
178+ } ,
179+ ] ,
180+ } ,
181+ ] ,
182+ } ,
183+ ] ,
184+ } ,
185+ } ;
186+
187+ /**
188+ * @type {import('../../../generated/generated.d.ts').Method }
189+ */
190+ const section = { } ;
191+
192+ parseSignatures ( entry , section ) ;
193+
194+ assert . deepStrictEqual ( section , {
195+ signatures : [
196+ {
197+ '@returns' : {
198+ '@type' : 'integer' ,
199+ description : 'something something something' ,
200+ } ,
201+ parameters : undefined ,
202+ } ,
203+ ] ,
204+ } ) ;
205+ } ) ;
206+
207+ test ( '`something.doThingWithUndefinedReturnType()`' , ( ) => {
208+ /**
209+ * ### `something.doThingWithReturnType()`
210+ *
211+ * * Returns: `undefined`
212+ */
213+
214+ /**
215+ * @type {import('../../../../../utils/buildHierarchy.mjs').HierarchizedEntry }
216+ */
217+ const entry = {
218+ heading : {
219+ data : {
220+ type : 'classMethod' ,
221+ text : '`something.doThingWithUndefinedReturnType()`' ,
222+ } ,
223+ } ,
224+ content : {
225+ type : 'root' ,
226+ children : [
227+ undefined , // this should be ignore
228+ {
229+ type : 'list' ,
230+ children : [
231+ {
232+ type : 'listItem' ,
233+ children : [
234+ {
235+ type : 'paragraph' ,
236+ children : [
237+ {
238+ type : 'text' ,
239+ value : 'Returns: ' ,
240+ } ,
241+ {
242+ type : 'inlineCode' ,
243+ value : 'undefined' ,
244+ } ,
245+ ] ,
246+ } ,
247+ ] ,
248+ } ,
249+ ] ,
250+ } ,
251+ ] ,
252+ } ,
253+ } ;
254+
255+ /**
256+ * @type {import('../../../generated/generated.d.ts').Method }
257+ */
258+ const section = { } ;
259+
260+ parseSignatures ( entry , section ) ;
261+
262+ assert . deepStrictEqual ( section , {
263+ signatures : [
264+ {
265+ '@returns' : {
266+ '@type' : 'undefined' ,
267+ } ,
268+ parameters : undefined ,
269+ } ,
270+ ] ,
271+ } ) ;
272+ } ) ;
273+
127274 test ( '`something.doThingWithoutParameterList(parameter)`' , ( ) => {
128275 /**
129276 * ### `something.doThingWithoutParameterList()`
0 commit comments