@@ -414,16 +414,14 @@ describe("Issue Tests", () => {
414
414
it ( "#1734" , ( ) => {
415
415
const project = convert ( ) ;
416
416
const alias = query ( project , "Foo" ) ;
417
- const type = alias . type ;
418
- ok ( type instanceof ReflectionType ) ;
419
417
420
418
const expectedComment = new Comment ( ) ;
421
419
expectedComment . blockTags = [
422
420
new CommentTag ( "@asdf" , [
423
421
{ kind : "text" , text : "Some example text" } ,
424
422
] ) ,
425
423
] ;
426
- equal ( type . declaration . signatures ?. [ 0 ] . comment , expectedComment ) ;
424
+ equal ( alias . comment , expectedComment ) ;
427
425
} ) ;
428
426
429
427
it ( "#1745" , ( ) => {
@@ -565,12 +563,9 @@ describe("Issue Tests", () => {
565
563
equal ( Type1 . type ?. type , "reflection" as const ) ;
566
564
equal ( Type2 . type ?. type , "reflection" as const ) ;
567
565
566
+ equal ( Type1 . comment , new Comment ( [ { kind : "text" , text : "On Tag" } ] ) ) ;
568
567
equal (
569
- Type1 . type . declaration . signatures ?. [ 0 ] . comment ,
570
- new Comment ( [ { kind : "text" , text : "On Tag" } ] ) ,
571
- ) ;
572
- equal (
573
- Type2 . type . declaration . signatures ?. [ 0 ] . comment ,
568
+ Type2 . comment ,
574
569
new Comment ( [ { kind : "text" , text : "Some type 2." } ] ) ,
575
570
) ;
576
571
} ) ;
@@ -579,7 +574,7 @@ describe("Issue Tests", () => {
579
574
const project = convert ( ) ;
580
575
app . validate ( project ) ;
581
576
logger . expectMessage (
582
- "warn: UnDocFn.__type , defined in */gh1898.ts, does not have any documentation." ,
577
+ "warn: UnDocFn (TypeAlias) , defined in */gh1898.ts, does not have any documentation." ,
583
578
) ;
584
579
} ) ;
585
580
@@ -1166,6 +1161,22 @@ describe("Issue Tests", () => {
1166
1161
equal ( ns ?. children ?. map ( ( c ) => c . name ) , [ "property" ] ) ;
1167
1162
} ) ;
1168
1163
1164
+ it ( "Puts delegate type alias comments on the type alias #2372" , ( ) => {
1165
+ const project = convert ( ) ;
1166
+ equal (
1167
+ getComment ( project , "EventHandler" ) ,
1168
+ "The signature for a function acting as an event handler." ,
1169
+ ) ;
1170
+
1171
+ const typeSig = query ( project , "EventHandler" ) . type ?. visit ( {
1172
+ reflection ( r ) {
1173
+ return r . declaration . signatures ! [ 0 ] ;
1174
+ } ,
1175
+ } ) ;
1176
+
1177
+ equal ( Comment . combineDisplayParts ( typeSig ?. comment ?. summary ) , "" ) ;
1178
+ } ) ;
1179
+
1169
1180
it ( "Handles spaces in JSDoc default parameter names #2384" , ( ) => {
1170
1181
const project = convert ( ) ;
1171
1182
const Typed = query ( project , "Typed" ) ;
0 commit comments