@@ -22,6 +22,8 @@ test( 'IR - undocumented', function( t ) {
2222 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( token ) ) , [ {
2323 name : 'default' ,
2424 description : 'Undocumented declaration.' ,
25+ params : [ ] ,
26+ return : [ ] ,
2527 tags : [ ] ,
2628 } ] ) ;
2729 const tokenOneliner = fs . readFileSync (
@@ -31,6 +33,8 @@ test( 'IR - undocumented', function( t ) {
3133 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenOneliner ) ) , [ {
3234 name : 'default' ,
3335 description : 'Undocumented declaration.' ,
36+ params : [ ] ,
37+ return : [ ] ,
3438 tags : [ ] ,
3539 } ] ) ;
3640 t . end ( ) ;
@@ -44,6 +48,8 @@ test( 'IR - default (JSDoc in export statement)', function( t ) {
4448 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenClassAnonymous ) ) , [ {
4549 name : 'default' ,
4650 description : 'Class declaration example.' ,
51+ params : [ ] ,
52+ return : [ ] ,
4753 tags : [ ] ,
4854 } ] ) ;
4955 const tokenClassNamed = fs . readFileSync (
@@ -53,6 +59,8 @@ test( 'IR - default (JSDoc in export statement)', function( t ) {
5359 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenClassNamed ) ) , [ {
5460 name : 'default' ,
5561 description : 'Class declaration example.' ,
62+ params : [ ] ,
63+ return : [ ] ,
5664 tags : [ ] ,
5765 } ] ) ;
5866 const tokenFnAnonymous = fs . readFileSync (
@@ -62,6 +70,8 @@ test( 'IR - default (JSDoc in export statement)', function( t ) {
6270 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenFnAnonymous ) ) , [ {
6371 name : 'default' ,
6472 description : 'Function declaration example.' ,
73+ params : [ ] ,
74+ return : [ ] ,
6575 tags : [ ] ,
6676 } ] ) ;
6777 const tokenFnNamed = fs . readFileSync (
@@ -71,6 +81,8 @@ test( 'IR - default (JSDoc in export statement)', function( t ) {
7181 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenFnNamed ) ) , [ {
7282 name : 'default' ,
7383 description : 'Function declaration example.' ,
84+ params : [ ] ,
85+ return : [ ] ,
7486 tags : [ ] ,
7587 } ] ) ;
7688 const tokenVariable = fs . readFileSync (
@@ -80,6 +92,8 @@ test( 'IR - default (JSDoc in export statement)', function( t ) {
8092 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenVariable ) ) , [ {
8193 name : 'default' ,
8294 description : 'Variable declaration example.' ,
95+ params : [ ] ,
96+ return : [ ] ,
8397 tags : [ ] ,
8498 } ] ) ;
8599 t . end ( ) ;
@@ -97,6 +111,8 @@ test( 'IR - default (JSDoc in same file)', function( t ) {
97111 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( token ) , JSON . parse ( ast ) ) , [ {
98112 name : 'default' ,
99113 description : 'Class declaration example.' ,
114+ params : [ ] ,
115+ return : [ ] ,
100116 tags : [ ] ,
101117 } ] ) ;
102118 const namedExport = fs . readFileSync (
@@ -109,11 +125,11 @@ test( 'IR - default (JSDoc in same file)', function( t ) {
109125 ) ;
110126 t . deepEqual (
111127 getIntermediateRepresentation ( JSON . parse ( namedExport ) [ 0 ] , JSON . parse ( namedExportAST ) ) ,
112- [ { name : 'functionDeclaration' , description : 'Function declaration example.' , tags : [ ] } ]
128+ [ { name : 'functionDeclaration' , description : 'Function declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ]
113129 ) ;
114130 t . deepEqual (
115131 getIntermediateRepresentation ( JSON . parse ( namedExport ) [ 1 ] , JSON . parse ( namedExportAST ) ) ,
116- [ { name : 'default' , description : 'Function declaration example.' , tags : [ ] } ]
132+ [ { name : 'default' , description : 'Function declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ]
117133 ) ;
118134 t . end ( ) ;
119135} ) ;
@@ -136,6 +152,8 @@ test( 'IR - default (JSDoc in module dependency)', function( t ) {
136152 [ {
137153 name : 'default' ,
138154 description : 'Function declaration.' ,
155+ params : [ ] ,
156+ return : [ ] ,
139157 tags : [ ] ,
140158 } ]
141159 ) ;
@@ -156,6 +174,8 @@ test( 'IR - default (JSDoc in module dependency)', function( t ) {
156174 [ {
157175 name : 'default' ,
158176 description : 'Function declaration.' ,
177+ params : [ ] ,
178+ return : [ ] ,
159179 tags : [ ] ,
160180 } ]
161181 ) ;
@@ -170,6 +190,8 @@ test( 'IR - named (JSDoc in export statement)', function( t ) {
170190 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenClass ) ) , [ {
171191 name : 'MyDeclaration' ,
172192 description : 'My declaration example.' ,
193+ params : [ ] ,
194+ return : [ ] ,
173195 tags : [ ] ,
174196 } ] ) ;
175197 const tokenFn = fs . readFileSync (
@@ -179,6 +201,8 @@ test( 'IR - named (JSDoc in export statement)', function( t ) {
179201 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenFn ) ) , [ {
180202 name : 'myDeclaration' ,
181203 description : 'My declaration example.' ,
204+ params : [ ] ,
205+ return : [ ] ,
182206 tags : [ ] ,
183207 } ] ) ;
184208 const tokenVariable = fs . readFileSync (
@@ -188,15 +212,17 @@ test( 'IR - named (JSDoc in export statement)', function( t ) {
188212 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenVariable ) ) , [ {
189213 name : 'myDeclaration' ,
190214 description : 'My declaration example.' ,
215+ params : [ ] ,
216+ return : [ ] ,
191217 tags : [ ] ,
192218 } ] ) ;
193219 const tokenVariables = fs . readFileSync (
194220 path . join ( __dirname , './fixtures/named-variables.json' ) ,
195221 'utf-8'
196222 ) ;
197223 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenVariables ) ) , [
198- { name : 'firstDeclaration' , description : 'My declaration example.' , tags : [ ] } ,
199- { name : 'secondDeclaration' , description : 'My declaration example.' , tags : [ ] } ,
224+ { name : 'firstDeclaration' , description : 'My declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
225+ { name : 'secondDeclaration' , description : 'My declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
200226 ] ) ;
201227 t . end ( ) ;
202228} ) ;
@@ -213,6 +239,8 @@ test( 'IR - named (JSDoc in same file)', function( t ) {
213239 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( token ) , JSON . parse ( ast ) ) , [ {
214240 name : 'myDeclaration' ,
215241 description : 'My declaration example.' ,
242+ params : [ ] ,
243+ return : [ ] ,
216244 tags : [ ] } ,
217245 ] ) ;
218246 const tokenObject = fs . readFileSync (
@@ -226,6 +254,8 @@ test( 'IR - named (JSDoc in same file)', function( t ) {
226254 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokenObject ) , JSON . parse ( astObject ) ) , [ {
227255 name : 'myDeclaration' ,
228256 description : 'My declaration example.' ,
257+ params : [ ] ,
258+ return : [ ] ,
229259 tags : [ ] } ,
230260 ] ) ;
231261 const tokens = fs . readFileSync (
@@ -237,9 +267,9 @@ test( 'IR - named (JSDoc in same file)', function( t ) {
237267 'utf-8'
238268 ) ;
239269 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( tokens ) , JSON . parse ( asts ) ) , [
240- { name : 'functionDeclaration' , description : 'Function declaration example.' , tags : [ ] } ,
241- { name : 'variableDeclaration' , description : 'Variable declaration example.' , tags : [ ] } ,
242- { name : 'ClassDeclaration' , description : 'Class declaration example.' , tags : [ ] } ,
270+ { name : 'functionDeclaration' , description : 'Function declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
271+ { name : 'variableDeclaration' , description : 'Variable declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
272+ { name : 'ClassDeclaration' , description : 'Class declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
243273 ] ) ;
244274 const foo = fs . readFileSync (
245275 path . join ( __dirname , './fixtures/named-identifiers-and-inline.json' ) ,
@@ -250,11 +280,11 @@ test( 'IR - named (JSDoc in same file)', function( t ) {
250280 'utf-8'
251281 ) ;
252282 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( foo ) [ 0 ] , JSON . parse ( bar ) ) , [
253- { name : 'functionDeclaration' , description : 'Function declaration example.' , tags : [ ] } ,
254- { name : 'ClassDeclaration' , description : 'Class declaration example.' , tags : [ ] } ,
283+ { name : 'functionDeclaration' , description : 'Function declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
284+ { name : 'ClassDeclaration' , description : 'Class declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
255285 ] ) ;
256286 t . deepEqual ( getIntermediateRepresentation ( JSON . parse ( foo ) [ 1 ] , JSON . parse ( bar ) ) , [
257- { name : 'variableDeclaration' , description : 'Variable declaration example.' , tags : [ ] } ,
287+ { name : 'variableDeclaration' , description : 'Variable declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ,
258288 ] ) ;
259289 t . end ( ) ;
260290} ) ;
@@ -270,7 +300,7 @@ test( 'IR - named (JSDoc in module dependency)', function( t ) {
270300 ) ) ;
271301 t . deepEqual (
272302 getIntermediateRepresentation ( JSON . parse ( tokenDefault ) , { body : [ ] } , getModule ) ,
273- [ { name : 'default' , description : 'Module declaration.' , tags : [ ] } ]
303+ [ { name : 'default' , description : 'Module declaration.' , params : [ ] , return : [ ] , tags : [ ] } ]
274304 ) ;
275305 const tokenImportNamed = fs . readFileSync (
276306 path . join ( __dirname , './fixtures/named-import-named.json' ) ,
@@ -282,15 +312,15 @@ test( 'IR - named (JSDoc in module dependency)', function( t ) {
282312 ) ) ;
283313 t . deepEqual (
284314 getIntermediateRepresentation ( JSON . parse ( tokenImportNamed ) , { body : [ ] } , getModuleImportNamed ) ,
285- [ { name : 'myDeclaration' , description : 'My declaration example.' , tags : [ ] } ]
315+ [ { name : 'myDeclaration' , description : 'My declaration example.' , params : [ ] , return : [ ] , tags : [ ] } ]
286316 ) ;
287317 const tokenDefaultExported = fs . readFileSync (
288318 path . join ( __dirname , './fixtures/named-default-exported.json' ) ,
289319 'utf-8'
290320 ) ;
291321 t . deepEqual (
292322 getIntermediateRepresentation ( JSON . parse ( tokenDefaultExported ) , { body : [ ] } , getModule ) ,
293- [ { name : 'moduleName' , description : 'Module declaration.' , tags : [ ] } ]
323+ [ { name : 'moduleName' , description : 'Module declaration.' , params : [ ] , return : [ ] , tags : [ ] } ]
294324 ) ;
295325 const tokenImportNamespace = fs . readFileSync (
296326 path . join ( __dirname , './fixtures/named-import-namespace.json' ) ,
@@ -314,7 +344,7 @@ test( 'IR - named (JSDoc in module dependency)', function( t ) {
314344 } ;
315345 t . deepEqual (
316346 getIntermediateRepresentation ( JSON . parse ( tokenImportNamespace ) , JSON . parse ( astImportNamespace ) , getModuleImportNamespace ) ,
317- [ { name : 'variables' , description : 'Undocumented declaration.' , tags : [ ] } ]
347+ [ { name : 'variables' , description : 'Undocumented declaration.' , params : [ ] , return : [ ] , tags : [ ] } ]
318348 ) ;
319349 t . end ( ) ;
320350} ) ;
@@ -331,9 +361,9 @@ test( 'IR - namespace (JSDoc in module dependency)', function( t ) {
331361 t . deepEqual (
332362 getIntermediateRepresentation ( JSON . parse ( token ) , { body : [ ] } , getModule ) ,
333363 [
334- { name : 'myVariable' , description : 'Named variable.' , tags : [ ] } ,
335- { name : 'myFunction' , description : 'Named function.' , tags : [ ] } ,
336- { name : 'MyClass' , description : 'Named class.' , tags : [ ] } ,
364+ { name : 'myVariable' , description : 'Named variable.' , params : [ ] , return : [ ] , tags : [ ] } ,
365+ { name : 'myFunction' , description : 'Named function.' , params : [ ] , return : [ ] , tags : [ ] } ,
366+ { name : 'MyClass' , description : 'Named class.' , params : [ ] , return : [ ] , tags : [ ] } ,
337367 ]
338368 ) ;
339369 const tokenCommented = fs . readFileSync (
@@ -343,9 +373,9 @@ test( 'IR - namespace (JSDoc in module dependency)', function( t ) {
343373 t . deepEqual (
344374 getIntermediateRepresentation ( JSON . parse ( tokenCommented ) , { body : [ ] } , getModule ) ,
345375 [
346- { name : 'myVariable' , description : 'Named variable.' , tags : [ ] } ,
347- { name : 'myFunction' , description : 'Named function.' , tags : [ ] } ,
348- { name : 'MyClass' , description : 'Named class.' , tags : [ ] } ,
376+ { name : 'myVariable' , description : 'Named variable.' , params : [ ] , return : [ ] , tags : [ ] } ,
377+ { name : 'myFunction' , description : 'Named function.' , params : [ ] , return : [ ] , tags : [ ] } ,
378+ { name : 'MyClass' , description : 'Named class.' , params : [ ] , return : [ ] , tags : [ ] } ,
349379 ]
350380 ) ;
351381 t . end ( ) ;
0 commit comments