Skip to content

Commit 57ffe4d

Browse files
committed
Preserve tokens for errors in DocParamBlock
1 parent 224af31 commit 57ffe4d

File tree

7 files changed

+563
-87
lines changed

7 files changed

+563
-87
lines changed

common/changes/@microsoft/tsdoc/flexibleParamParsing_2019-12-20-01-20.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"packageName": "@microsoft/tsdoc",
55
"comment": "Improve parse for param/typeParam",
6-
"type": "patch"
6+
"type": "minor"
77
}
88
],
99
"packageName": "@microsoft/tsdoc",

tsdoc/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
registry=https://registry.npmjs.org/
22
always-auth=false
3+
package-lock=false

tsdoc/.vscode/launch.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
"request": "launch",
1919
"name": "Jest Current File",
2020
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
21-
"args": ["${relativeFile}"],
21+
"args": [
22+
"--runInBand",
23+
"--testPathPattern",
24+
"${fileBasename}"
25+
],
2226
"console": "integratedTerminal",
2327
"internalConsoleOptions": "neverOpen"
2428
}

tsdoc/src/__tests__/ParsingBasics.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,27 @@ test('05 Invalid JSDoc syntax in @param blocks', () => {
134134
].join('\n'));
135135
});
136136

137+
test('06 Invalid JSDoc optional name', () => {
138+
TestHelpers.parseAndMatchDocCommentSnapshot([
139+
'/**',
140+
' * Example 1',
141+
' *',
142+
' * @param [n - this is',
143+
' * the description',
144+
' *',
145+
' * @public',
146+
' */'
147+
].join('\n'));
148+
});
149+
150+
test('07 Invalid JSDoc type', () => {
151+
TestHelpers.parseAndMatchDocCommentSnapshot([
152+
'/**',
153+
' * Example 1',
154+
' *',
155+
' * @param { test',
156+
' *',
157+
' * @public',
158+
' */'
159+
].join('\n'));
160+
});

0 commit comments

Comments
 (0)