Skip to content

Commit 7daa6a7

Browse files
committed
Add unit tests for constructors and construct signatures
1 parent 767874a commit 7daa6a7

9 files changed

+161
-1
lines changed

build-tests/api-documenter-test/etc/api-documenter-test.api.json

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,62 @@
3434
],
3535
"releaseTag": "Public",
3636
"name": "DocBaseClass",
37-
"members": [],
37+
"members": [
38+
{
39+
"kind": "Constructor",
40+
"canonicalReference": "(:constructor,instance,0)",
41+
"docComment": "/**\n * The simple constructor for `DocBaseClass`\n */\n",
42+
"excerptTokens": [
43+
{
44+
"kind": "Content",
45+
"text": "constructor();"
46+
}
47+
],
48+
"isStatic": false,
49+
"releaseTag": "Public",
50+
"overloadIndex": 0,
51+
"parameters": []
52+
},
53+
{
54+
"kind": "Constructor",
55+
"canonicalReference": "(:constructor,instance,1)",
56+
"docComment": "/**\n * The overloaded constructor for `DocBaseClass`\n */\n",
57+
"excerptTokens": [
58+
{
59+
"kind": "Content",
60+
"text": "constructor("
61+
},
62+
{
63+
"kind": "Reference",
64+
"text": "x"
65+
},
66+
{
67+
"kind": "Content",
68+
"text": ": "
69+
},
70+
{
71+
"kind": "Content",
72+
"text": "number"
73+
},
74+
{
75+
"kind": "Content",
76+
"text": ");"
77+
}
78+
],
79+
"isStatic": false,
80+
"releaseTag": "Public",
81+
"overloadIndex": 1,
82+
"parameters": [
83+
{
84+
"parameterName": "x",
85+
"parameterTypeTokenRange": {
86+
"startIndex": 3,
87+
"endIndex": 4
88+
}
89+
}
90+
]
91+
}
92+
],
3893
"implementsTokenRanges": []
3994
},
4095
{

build-tests/api-documenter-test/etc/api-documenter-test.api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export const constVariable: number;
99

1010
// @public
1111
export class DocBaseClass {
12+
constructor();
13+
constructor(x: number);
1214
}
1315

1416
// @public
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [api-documenter-test](./api-documenter-test.md) &gt; [DocBaseClass](./api-documenter-test.docbaseclass.md) &gt; [(constructor)](./api-documenter-test.docbaseclass.(constructor).md)
4+
5+
## DocBaseClass.(constructor)
6+
7+
The simple constructor for `DocBaseClass`
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor();
13+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [api-documenter-test](./api-documenter-test.md) &gt; [DocBaseClass](./api-documenter-test.docbaseclass.md) &gt; [(constructor)](./api-documenter-test.docbaseclass.(constructor)_1.md)
4+
5+
## DocBaseClass.(constructor)
6+
7+
The overloaded constructor for `DocBaseClass`
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor(x: number);
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| x | <code>number</code> | |
20+

build-tests/api-documenter-test/etc/markdown/api-documenter-test.docbaseclass.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ Example base class
1212
```typescript
1313
export declare class DocBaseClass
1414
```
15+
16+
## Constructors
17+
18+
| Constructor | Modifiers | Description |
19+
| --- | --- | --- |
20+
| [(constructor)()](./api-documenter-test.docbaseclass.(constructor).md) | | The simple constructor for <code>DocBaseClass</code> |
21+
| [(constructor)(x)](./api-documenter-test.docbaseclass.(constructor)_1.md) | | The overloaded constructor for <code>DocBaseClass</code> |
22+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [api-documenter-test](./api-documenter-test.md) &gt; [IDocInterface3](./api-documenter-test.idocinterface3.md) &gt; [(new)](./api-documenter-test.idocinterface3.(new).md)
4+
5+
## IDocInterface3.(new)
6+
7+
Construct signature
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
new (): IDocInterface1;
13+
```
14+
<b>Returns:</b>
15+
16+
`IDocInterface1`
17+

build-tests/api-documenter-test/etc/markdown/api-documenter-test.idocinterface3.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ Some less common TypeScript declaration kinds.
1212
```typescript
1313
export interface IDocInterface3
1414
```
15+
16+
## Methods
17+
18+
| Method | Description |
19+
| --- | --- |
20+
| [(new)()](./api-documenter-test.idocinterface3.(new).md) | Construct signature |
21+

build-tests/api-documenter-test/etc/yaml/api-documenter-test/docbaseclass.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,29 @@ items:
88
- typeScript
99
type: class
1010
package: api-documenter-test
11+
children:
12+
- api-documenter-test.DocBaseClass.(constructor)
13+
- api-documenter-test.DocBaseClass.(constructor)_1
14+
- uid: api-documenter-test.DocBaseClass.(constructor)
15+
summary: The simple constructor for `DocBaseClass`
16+
name: (constructor)()
17+
fullName: (constructor)()
18+
langs:
19+
- typeScript
20+
type: constructor
21+
syntax:
22+
content: constructor();
23+
- uid: api-documenter-test.DocBaseClass.(constructor)_1
24+
summary: The overloaded constructor for `DocBaseClass`
25+
name: (constructor)(x)
26+
fullName: (constructor)(x)
27+
langs:
28+
- typeScript
29+
type: constructor
30+
syntax:
31+
content: 'constructor(x: number);'
32+
parameters:
33+
- id: x
34+
description: ''
35+
type:
36+
- number

build-tests/api-documenter-test/src/DocClass1.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ export class SystemEvent {
1818
* {@docCategory DocBaseClass}
1919
*/
2020
export class DocBaseClass {
21+
/**
22+
* The simple constructor for `DocBaseClass`
23+
*/
24+
public constructor();
25+
26+
/**
27+
* The overloaded constructor for `DocBaseClass`
28+
*/
29+
public constructor(x: number);
30+
31+
public constructor(x?: number) {
32+
}
2133
}
2234

2335
/**

0 commit comments

Comments
 (0)