Skip to content

Commit 42a1759

Browse files
committed
Add a test for #2545
1 parent 657eb4b commit 42a1759

File tree

2 files changed

+73
-37
lines changed

2 files changed

+73
-37
lines changed

src/test/converter2/issues/gh2545.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
abstract class Parent {
2+
/**
3+
* notAbstract docs
4+
*/
5+
notAbstract(): string {
6+
return "hello";
7+
}
8+
/**
9+
* notAbstract2 docs
10+
*/
11+
notAbstract2(): string {
12+
return "hello";
13+
}
14+
/**
15+
* isAbstract docs
16+
*/
17+
abstract isAbstract(): string;
18+
}
19+
20+
export class Child extends Parent {
21+
override notAbstract2(): string {
22+
return "foo";
23+
}
24+
override isAbstract(): string {
25+
return "bar";
26+
}
27+
}

src/test/issues.c2.test.ts

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe("Issue Tests", () => {
131131
ok(nsFoo.children?.find((r) => r.name === "x"));
132132
});
133133

134-
it("Supports computed names #941", () => {
134+
it("#941 Supports computed names ", () => {
135135
const project = convert();
136136
const obj = query(project, "Obj");
137137
equal(
@@ -397,7 +397,7 @@ describe("Issue Tests", () => {
397397
equal(ctor.sources[0].character, 4);
398398
});
399399

400-
it("Handles comment discovery with expando functions #1651", () => {
400+
it("#1651 Handles comment discovery with expando functions ", () => {
401401
const project = convert();
402402
equal(
403403
project.children?.map((c) => c.name),
@@ -954,7 +954,7 @@ describe("Issue Tests", () => {
954954
);
955955
});
956956

957-
it("Handles types/values with same name #2106", () => {
957+
it("#2106 Handles types/values with same name ", () => {
958958
const project = convert();
959959
const balance = querySig(project, "balance");
960960
equal(balance.type?.type, "reference");
@@ -1104,7 +1104,7 @@ describe("Issue Tests", () => {
11041104
}
11051105
});
11061106

1107-
it("Handles implementationOf with symbols #2234", () => {
1107+
it("#2234 Handles implementationOf with symbols ", () => {
11081108
const project = convert();
11091109
const cm = query(project, "CharMap");
11101110
equal(
@@ -1118,7 +1118,7 @@ describe("Issue Tests", () => {
11181118
);
11191119
});
11201120

1121-
it("Handles http links with TS link resolution #2270", () => {
1121+
it("#2270 Handles http links with TS link resolution ", () => {
11221122
const project = convert();
11231123
const links = getLinks(query(project, "A"));
11241124
equal(links, [
@@ -1133,7 +1133,7 @@ describe("Issue Tests", () => {
11331133
]);
11341134
});
11351135

1136-
it("Handles comments on interfaces with call signatures #2290", () => {
1136+
it("#2290 Handles comments on interfaces with call signatures ", () => {
11371137
const project = convert();
11381138

11391139
equal(getComment(project, "CallSignature"), "Int comment");
@@ -1156,14 +1156,14 @@ describe("Issue Tests", () => {
11561156
);
11571157
});
11581158

1159-
it("Does not warn on notDocumented edge case #2291", () => {
1159+
it("#2291 Does not warn on notDocumented edge case ", () => {
11601160
app.options.setValue("validation", { notDocumented: true });
11611161
const project = convert();
11621162
app.validate(project);
11631163
logger.expectNoOtherMessages();
11641164
});
11651165

1166-
it("Supports TS 5.0 #2296", () => {
1166+
it("#2296 Supports TS 5.0 ", () => {
11671167
const project = convert();
11681168
const names = query(project, "names");
11691169
equal(names.type?.toString(), 'readonly ["Alice", "Bob", "Eve"]');
@@ -1174,7 +1174,7 @@ describe("Issue Tests", () => {
11741174
equal(tp.flags.isConst, true);
11751175
});
11761176

1177-
it("Detects source locations coming from types and prefers value declarations, #2307", () => {
1177+
it("#2307 Detects source locations coming from types and prefers value declarations, ", () => {
11781178
const project = convert();
11791179

11801180
const getLines = (name: string) => {
@@ -1189,14 +1189,14 @@ describe("Issue Tests", () => {
11891189
equal(getLines("all"), [8, 9]);
11901190
});
11911191

1192-
it("Uses type parameters from parent class in arrow-methods, #2320", () => {
1192+
it("#2320 Uses type parameters from parent class in arrow-methods, ", () => {
11931193
const project = convert();
11941194
const arrow = querySig(project, "ResolvedSubclass.arrowFunction");
11951195

11961196
equal(arrow.typeParameters![0].type?.toString(), '"one" | "two"');
11971197
});
11981198

1199-
it("Handles comments with nested methods #2336", () => {
1199+
it("#2336 Handles comments with nested methods ", () => {
12001200
const project = convert();
12011201

12021202
const outer = querySig(project, "ClassVersion.outer");
@@ -1211,15 +1211,15 @@ describe("Issue Tests", () => {
12111211
);
12121212
});
12131213

1214-
it("Supports nested paths with tsLinkResolution #2360", () => {
1214+
it("#2360 Supports nested paths with tsLinkResolution ", () => {
12151215
const project = convert();
12161216
const x = query(project, "x");
12171217
const link = x.comment?.summary[0];
12181218
equal(link?.kind, "inline-tag");
12191219
equal(link.target, query(project, "Foo.bar"));
12201220
});
12211221

1222-
it("Handles duplicate declarations with @namespace #2364", () => {
1222+
it("#2364 Handles duplicate declarations with @namespace ", () => {
12231223
const project = convert();
12241224
equal(
12251225
project.children?.map((c) => c.name),
@@ -1232,7 +1232,7 @@ describe("Issue Tests", () => {
12321232
);
12331233
});
12341234

1235-
it("Gets properties when types/variables are merged with @namespace #2364", () => {
1235+
it("#2364 Gets properties when types/variables are merged with @namespace ", () => {
12361236
const project = convert();
12371237
const ns = project.children?.find(
12381238
(c) => c.name == "NS2" && c.kind == ReflectionKind.Namespace,
@@ -1243,7 +1243,7 @@ describe("Issue Tests", () => {
12431243
);
12441244
});
12451245

1246-
it("Puts delegate type alias comments on the type alias #2372", () => {
1246+
it("#2372 Puts delegate type alias comments on the type alias ", () => {
12471247
const project = convert();
12481248
equal(
12491249
getComment(project, "EventHandler"),
@@ -1259,7 +1259,7 @@ describe("Issue Tests", () => {
12591259
equal(Comment.combineDisplayParts(typeSig?.comment?.summary), "");
12601260
});
12611261

1262-
it("Handles spaces in JSDoc default parameter names #2384", () => {
1262+
it("#2384 Handles spaces in JSDoc default parameter names ", () => {
12631263
const project = convert();
12641264
const Typed = query(project, "Typed");
12651265
equal(Typed.typeParameters?.length, 1);
@@ -1271,7 +1271,7 @@ describe("Issue Tests", () => {
12711271
);
12721272
});
12731273

1274-
it("Handles @template parameter constraints correctly, #2389", () => {
1274+
it("#2389 Handles @template parameter constraints correctly, ", () => {
12751275
const project = convert();
12761276
const foo = query(project, "foo");
12771277
equal(foo.signatures?.length, 1);
@@ -1286,15 +1286,15 @@ describe("Issue Tests", () => {
12861286
// a single declare module can still have a comment on them, but it looks really
12871287
// weird and wrong if there are multiple declare module statements in a file...
12881288
// there's probably some nicer way of doing this that I'm not seeing right now.
1289-
it("Uses module comment discovery on 'declare module \"foo\"' #2401", () => {
1289+
it("#2401 Uses module comment discovery on 'declare module \"foo\"' ", () => {
12901290
const project = convert();
12911291
equal(
12921292
Comment.combineDisplayParts(project.comment?.summary),
12931293
"Comment for module",
12941294
);
12951295
});
12961296

1297-
it("Includes index signature comments #2414", () => {
1297+
it("#2414 Includes index signature comments ", () => {
12981298
const project = convert();
12991299
equal(
13001300
Comment.combineDisplayParts(
@@ -1305,7 +1305,7 @@ describe("Issue Tests", () => {
13051305
);
13061306
});
13071307

1308-
it("Handles destructured object parameter defaults, #2430", () => {
1308+
it("#2430 Handles destructured object parameter defaults, ", () => {
13091309
const project = convert();
13101310
const Checkbox = querySig(project, "Checkbox");
13111311
equal(Checkbox.parameters?.length, 1);
@@ -1322,7 +1322,7 @@ describe("Issue Tests", () => {
13221322
);
13231323
});
13241324

1325-
it("Handles function-namespaces created with Object.assign #2436", () => {
1325+
it("#2436 Handles function-namespaces created with Object.assign ", () => {
13261326
const project = convert();
13271327
equal(query(project, "bug").kind, ReflectionKind.Function);
13281328
const foo = query(project, "bug.foo");
@@ -1333,32 +1333,32 @@ describe("Issue Tests", () => {
13331333
equal(bar.kind, ReflectionKind.Property, "property");
13341334
});
13351335

1336-
it("Does not warn due to the diamond problem in comment discovery #2437", () => {
1336+
it("#2437 Does not warn due to the diamond problem in comment discovery ", () => {
13371337
convert();
13381338
logger.expectNoOtherMessages();
13391339
});
13401340

1341-
it("Handles recursive aliases without looping infinitely #2438", () => {
1341+
it("#2438 Handles recursive aliases without looping infinitely ", () => {
13421342
const bad = query(convert(), "Bad");
13431343
equal(bad.kind, ReflectionKind.Interface);
13441344
});
13451345

1346-
it("Handles transient symbols correctly, #2444", () => {
1346+
it("#2444 Handles transient symbols correctly, ", () => {
13471347
const project = convert();
13481348
const boolEq = query(project, "Boolean.equal");
13491349
const numEq = query(project, "Number.equal");
13501350
equal(boolEq.signatures![0].parameters![0].type?.toString(), "boolean");
13511351
equal(numEq.signatures![0].parameters![0].type?.toString(), "number");
13521352
});
13531353

1354-
it("Handles unions created due to union within intersection, #2451", () => {
1354+
it("#2451 Handles unions created due to union within intersection, ", () => {
13551355
const project = convert();
13561356

13571357
const is = querySig(project, "FooA.is");
13581358
equal(is.type?.toString(), "this is Foo & Object");
13591359
});
13601360

1361-
it("Does not care about conversion order for @link resolution, #2466", () => {
1361+
it("#2466 Does not care about conversion order for @link resolution, ", () => {
13621362
const project = convert();
13631363

13641364
const Two = query(project, "Two");
@@ -1378,7 +1378,7 @@ describe("Issue Tests", () => {
13781378
]);
13791379
});
13801380

1381-
it("Creates a separate namespace for `declare namespace` case #2476", () => {
1381+
it("#2476 Creates a separate namespace for `declare namespace` case ", () => {
13821382
const project = convert();
13831383

13841384
equal(
@@ -1395,7 +1395,7 @@ describe("Issue Tests", () => {
13951395
);
13961396
});
13971397

1398-
it("Creates a separate namespace for `declare namespace` case with variables #2478", () => {
1398+
it("#2478 Creates a separate namespace for `declare namespace` case with variables ", () => {
13991399
const project = convert();
14001400

14011401
equal(
@@ -1412,7 +1412,7 @@ describe("Issue Tests", () => {
14121412
);
14131413
});
14141414

1415-
it("Does not crash when rendering recursive hierarchy, #2495", () => {
1415+
it("#2495 Does not crash when rendering recursive hierarchy, ", () => {
14161416
const project = convert();
14171417

14181418
const theme = new DefaultTheme(app.renderer);
@@ -1422,18 +1422,18 @@ describe("Issue Tests", () => {
14221422
context.hierarchyTemplate(page);
14231423
});
14241424

1425-
it("Correctly cleans up references to functions #2496", () => {
1425+
it("#2496 Correctly cleans up references to functions ", () => {
14261426
app.options.setValue("excludeNotDocumented", true);
14271427
convert();
14281428
});
14291429

1430-
it("Sorts literal numeric unions when converting a type, #2502", () => {
1430+
it("#2502 Sorts literal numeric unions when converting a type, ", () => {
14311431
const project = convert();
14321432
const refl = query(project, "Test");
14331433
equal(refl.type?.toString(), "1 | 2 | 3");
14341434
});
14351435

1436-
it("Handles an infinitely recursive type, #2507", () => {
1436+
it("#2507 Handles an infinitely recursive type, ", () => {
14371437
const project = convert();
14381438
const type = querySig(project, "fromPartial").typeParameters![0].type;
14391439

@@ -1451,15 +1451,15 @@ describe("Issue Tests", () => {
14511451
equal(type?.toString(), "Value & Object");
14521452
});
14531453

1454-
it("Handles constructed references to enumeration types, #2508", () => {
1454+
it("#2508 Handles constructed references to enumeration types, ", () => {
14551455
const project = convert();
14561456
const refl = query(project, "Bar.color");
14571457
equal(refl.type?.type, "reference");
14581458
equal(refl.type.toString(), "Color");
14591459
equal(refl.type.reflection?.id, query(project, "Color").id);
14601460
});
14611461

1462-
it("Does not duplicate comments due to signatures being present, #2509", () => {
1462+
it("#2509 Does not duplicate comments due to signatures being present, ", () => {
14631463
const project = convert();
14641464
const cb = query(project, "Int.cb");
14651465
equal(Comment.combineDisplayParts(cb.comment?.summary), "Cb");
@@ -1474,7 +1474,7 @@ describe("Issue Tests", () => {
14741474
equal(cb2.type.declaration.signatures![0].comment, undefined);
14751475
});
14761476

1477-
it("Specifying comment on variable still inherits signature comments, #2521", () => {
1477+
it("#2521 Specifying comment on variable still inherits signature comments, ", () => {
14781478
const project = convert();
14791479

14801480
equal(getComment(project, "fooWithoutComment"), "");
@@ -1486,7 +1486,16 @@ describe("Issue Tests", () => {
14861486
equal(getSigComment(project, "fooWithComment", 1), "Overload 2");
14871487
});
14881488

1489-
it("Ignores @license and @import comments, #2552", () => {
1489+
it.skip("#2545 discovers comments from non-exported 'parent' methods", () => {
1490+
// Currently failing
1491+
const project = convert();
1492+
1493+
equal(getComment(project, "Child.notAbstract"), "notAbstract docs");
1494+
equal(getComment(project, "Child.notAbstract2"), "notAbstract2 docs");
1495+
equal(getComment(project, "Child.isAbstract"), "isAbstract docs");
1496+
});
1497+
1498+
it("#2552 Ignores @license and @import comments, ", () => {
14901499
const project = convert();
14911500
equal(
14921501
Comment.combineDisplayParts(project.comment?.summary),
@@ -1495,7 +1504,7 @@ describe("Issue Tests", () => {
14951504
equal(getComment(project, "something"), "");
14961505
});
14971506

1498-
it("Does not warn about documented constructor signature type aliases, #2553", () => {
1507+
it("#2553 Does not warn about documented constructor signature type aliases, ", () => {
14991508
const project = convert();
15001509
app.validate(project);
15011510
logger.expectNoOtherMessages();

0 commit comments

Comments
 (0)