mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Add tests for jsdoccomments.
This commit is contained in:
@@ -448,6 +448,10 @@ module FourSlashInterface {
|
||||
FourSlash.currentTestState.verifyQuickInfoDisplayParts(kind, kindModifiers, textSpan, displayParts, documentation);
|
||||
}
|
||||
|
||||
public getSyntacticDiagnostics(expected: string) {
|
||||
FourSlash.currentTestState.getSyntacticDiagnostics(expected);
|
||||
}
|
||||
|
||||
public getSemanticDiagnostics(expected: string) {
|
||||
FourSlash.currentTestState.getSemanticDiagnostics(expected);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: a.js
|
||||
//// function foo(...a) {}
|
||||
|
||||
verify.getSemanticDiagnostics(`[]`);
|
||||
19
tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts
Normal file
19
tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: a.js
|
||||
//// /**
|
||||
//// * @type {number}
|
||||
//// * @type {string}
|
||||
//// */
|
||||
//// var v;
|
||||
|
||||
verify.getSyntacticDiagnostics(`[
|
||||
{
|
||||
"message": "\'type\' tag already specified.",
|
||||
"start": 26,
|
||||
"length": 4,
|
||||
"category": "error",
|
||||
"code": 1219
|
||||
}
|
||||
]`);
|
||||
Reference in New Issue
Block a user