mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Respond to code review comments
This commit is contained in:
parent
c83054cd4b
commit
6902b050ca
@ -19,33 +19,33 @@ module ts {
|
||||
|
||||
it("Generates correct compilerOptions diagnostics", () => {
|
||||
// Expecting 5047: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher."
|
||||
runTest(`var x = 0;`, {}, /*expectedOutput*/ undefined, [5047]);
|
||||
runTest(`var x = 0;`, {}, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [5047]);
|
||||
});
|
||||
|
||||
it("Generates no diagnostics with valid inputs", () => {
|
||||
// No errors
|
||||
runTest(`var x = 0;`, { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, []);
|
||||
runTest(`var x = 0;`, { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
|
||||
});
|
||||
|
||||
it("Generates no diagnostics for missing file references", () => {
|
||||
runTest(`/// <reference path="file2.ts" />
|
||||
var x = 0;`,
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, []);
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
|
||||
});
|
||||
|
||||
it("Generates no diagnostics for missing module imports", () => {
|
||||
runTest(`import {a} from "module2";`,
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, []);
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
|
||||
});
|
||||
|
||||
it("Generates expected syntactic diagnostics", () => {
|
||||
runTest(`a b`,
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, [1005]); /// 1005: ';' Expected
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [1005]); /// 1005: ';' Expected
|
||||
});
|
||||
|
||||
it("Does not generate semantic diagnostics", () => {
|
||||
runTest(`var x: string = 0;`,
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, []);
|
||||
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
|
||||
});
|
||||
|
||||
it("Generates module output", () => {
|
||||
@ -53,7 +53,7 @@ var x = 0;`,
|
||||
});
|
||||
|
||||
it("Uses correct newLine character", () => {
|
||||
runTest(`var x = 0;`, { module: ModuleKind.CommonJS, newLine: NewLineKind.LineFeed }, `var x = 0;\n`);
|
||||
runTest(`var x = 0;`, { module: ModuleKind.CommonJS, newLine: NewLineKind.LineFeed }, `var x = 0;\n`, /*expectedDiagnosticCodes*/ []);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user