@@ -180,30 +180,34 @@ describe("unittests:: Public APIs:: validateLocaleAndSetLanguage", () => {
180
180
} ) ;
181
181
182
182
describe ( "unittests:: Public APIs :: forEachChild of @param comments in JSDoc" , ( ) => {
183
- const content = `
183
+ it ( "finds correct children" , ( ) => {
184
+ const content = `
184
185
/**
185
186
* @param The {@link TypeReferencesInAedoc}.
186
187
*/
187
188
var x
188
189
` ;
189
- const sourceFile = ts . createSourceFile ( "/file.ts" , content , ts . ScriptTarget . ESNext , /*setParentNodes*/ true ) ;
190
- const paramTag = sourceFile . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] ;
191
- const kids = paramTag . getChildren ( ) ;
192
- const seen : Set < ts . Node > = new Set ( ) ;
193
- ts . forEachChild ( paramTag , n => {
194
- assert . strictEqual ( /*actual*/ false , seen . has ( n ) , "Found a duplicate-added child" ) ;
195
- seen . add ( n ) ;
190
+ const sourceFile = ts . createSourceFile ( "/file.ts" , content , ts . ScriptTarget . ESNext , /*setParentNodes*/ true ) ;
191
+ const paramTag = sourceFile . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] ;
192
+ const kids = paramTag . getChildren ( ) ;
193
+ const seen : Set < ts . Node > = new Set ( ) ;
194
+ ts . forEachChild ( paramTag , n => {
195
+ assert . strictEqual ( /*actual*/ false , seen . has ( n ) , "Found a duplicate-added child" ) ;
196
+ seen . add ( n ) ;
197
+ } ) ;
198
+ assert . equal ( 5 , kids . length ) ;
196
199
} ) ;
197
- assert . equal ( 5 , kids . length ) ;
198
200
} ) ;
199
201
200
202
describe ( "unittests:: Public APIs:: getChild* methods on EndOfFileToken with JSDoc" , ( ) => {
201
- const content = `
203
+ it ( "finds correct children" , ( ) => {
204
+ const content = `
202
205
/** jsdoc comment attached to EndOfFileToken */
203
206
` ;
204
- const sourceFile = ts . createSourceFile ( "/file.ts" , content , ts . ScriptTarget . ESNext , /*setParentNodes*/ true ) ;
205
- const endOfFileToken = sourceFile . getChildren ( ) [ 1 ] ;
206
- assert . equal ( endOfFileToken . getChildren ( ) . length , 1 ) ;
207
- assert . equal ( endOfFileToken . getChildCount ( ) , 1 ) ;
208
- assert . notEqual ( endOfFileToken . getChildAt ( 0 ) , /*expected*/ undefined ) ;
207
+ const sourceFile = ts . createSourceFile ( "/file.ts" , content , ts . ScriptTarget . ESNext , /*setParentNodes*/ true ) ;
208
+ const endOfFileToken = sourceFile . getChildren ( ) [ 1 ] ;
209
+ assert . equal ( endOfFileToken . getChildren ( ) . length , 1 ) ;
210
+ assert . equal ( endOfFileToken . getChildCount ( ) , 1 ) ;
211
+ assert . notEqual ( endOfFileToken . getChildAt ( 0 ) , /*expected*/ undefined ) ;
212
+ } ) ;
209
213
} ) ;
0 commit comments