@@ -8,6 +8,16 @@ import {
88 parseList ,
99} from '../parseList.mjs' ;
1010
11+ const validTypedList = [
12+ { type : 'inlineCode' , value : 'option' } , // inline code
13+ { type : 'text' , value : ' ' } , // space
14+ {
15+ type : 'link' ,
16+ children : [ { type : 'text' , value : '<boolean>' } ] , // link with < value
17+ } ,
18+ { type : 'text' , value : ' option description' } ,
19+ ] ;
20+
1121describe ( 'transformTypeReferences' , ( ) => {
1222 it ( 'replaces template syntax with curly braces' , ( ) => {
1323 const result = transformTypeReferences ( '`<string>`' ) ;
@@ -90,7 +100,7 @@ describe('parseList', () => {
90100 children : [
91101 {
92102 type : 'paragraph' ,
93- children : [ { type : 'text' , value : '{string} description' } ] ,
103+ children : validTypedList ,
94104 } ,
95105 ] ,
96106 } ,
@@ -134,9 +144,7 @@ describe('parseList', () => {
134144 children : [
135145 {
136146 type : 'paragraph' ,
137- children : [
138- { type : 'text' , value : 'param1 {string} first parameter' } ,
139- ] ,
147+ children : validTypedList ,
140148 } ,
141149 // This is a nested typed list
142150 {
@@ -146,15 +154,7 @@ describe('parseList', () => {
146154 children : [
147155 {
148156 type : 'paragraph' ,
149- children : [
150- { type : 'inlineCode' , value : 'option' } , // inline code
151- { type : 'text' , value : ' ' } , // space
152- {
153- type : 'link' ,
154- children : [ { type : 'text' , value : '<boolean>' } ] , // link with < value
155- } ,
156- { type : 'text' , value : ' option description' } ,
157- ] ,
157+ children : validTypedList ,
158158 } ,
159159 ] ,
160160 } ,
@@ -167,6 +167,9 @@ describe('parseList', () => {
167167 ] ;
168168
169169 parseList ( section , nodes ) ;
170+
171+ console . log ( section ) ;
172+
170173 assert . equal ( section . params [ 0 ] . options . length , 1 ) ;
171174 } ) ;
172175} ) ;
0 commit comments