Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions out/src/typedocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ var Main;
break;
case ts.SyntaxKind.AnyKeyword:
case ts.SyntaxKind.ArrayType:
case ts.SyntaxKind.BigIntKeyword:
case ts.SyntaxKind.BooleanKeyword:
case ts.SyntaxKind.ConstructorType:
case ts.SyntaxKind.ExpressionWithTypeArguments:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"marked": "0.6.2",
"typescript": "3.0.3"
"typescript": "3.2.4"
},
"devDependencies": {
"@types/marked": "^0.6.5",
Expand Down
1 change: 1 addition & 0 deletions src/typedocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ module Main {
break;
case ts.SyntaxKind.AnyKeyword:
case ts.SyntaxKind.ArrayType:
case ts.SyntaxKind.BigIntKeyword:
case ts.SyntaxKind.BooleanKeyword:
case ts.SyntaxKind.ConstructorType:
case ts.SyntaxKind.ExpressionWithTypeArguments:
Expand Down
9 changes: 7 additions & 2 deletions test/testcases/testvariables.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ declare module "ModuleWithVariables" {
/**
* Defines an exported constant.
*/
const exportedConstant: string;
const exportedConstant: number;

/**
* Defines an exported variable.
* Defines an exported let.
*/
let modifiableVariable: string;

/**
* Defines an exported variable.
*/
var bigintVar: bigint;
}
14 changes: 12 additions & 2 deletions test/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@ describe("Variables", function () {
it("should generate documentation for exported constant correctly", function () {
const exportedConstant = <syntax.VariableDeclaration>(<syntax.ModuleDeclaration>elements[0]).members[0];
assert.equal(exportedConstant.name, "exportedConstant", "name of constant is correct");
assert.equal(exportedConstant.type, "number", "type of constant is correct");
assert.equal(exportedConstant.documentation, "Defines an exported constant.", "documentation of constant is correct");
assert.equal(exportedConstant.isConst, true, `isConst flag should be set to true. Actual: ${JSON.stringify(exportedConstant)}`);
});

it("should generate documentation for exported let correctly", function () {
const exportedLet = <syntax.VariableDeclaration>(<syntax.ModuleDeclaration>elements[0]).members[1];
assert.equal(exportedLet.name, "modifiableVariable", `name of let is correct.`);
assert.equal(exportedLet.type, "string", "type of let is correct");
assert.equal(exportedLet.documentation, "Defines an exported let.", "documentation of constant is correct");
assert.equal(exportedLet.isConst, false, `isConst flag should be set to false. Actual: ${JSON.stringify(exportedLet)}`);
});

it("should generate documentation for exported variable correctly", function () {
const exportedVariable = <syntax.VariableDeclaration>(<syntax.ModuleDeclaration>elements[0]).members[1];
assert.equal(exportedVariable.name, "modifiableVariable", `name of variable is correct.`);
const exportedVariable = <syntax.VariableDeclaration>(<syntax.ModuleDeclaration>elements[0]).members[2];
assert.equal(exportedVariable.name, "bigintVar", `name of variable is correct.`);
assert.equal(exportedVariable.type, "bigint", "type of let is correct");
assert.equal(exportedVariable.documentation, "Defines an exported variable.", "documentation of constant is correct");
assert.equal(exportedVariable.isConst, false, `isConst flag should be set to false. Actual: ${JSON.stringify(exportedVariable)}`);
});
Expand Down