@@ -19,41 +19,41 @@ module ts {
19
19
20
20
it ( "Generates correct compilerOptions diagnostics" , ( ) => {
21
21
// Expecting 5047: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher."
22
- runTest ( `var x = 0;` , { } , /*expectedOutput*/ undefined , [ 5047 ] ) ;
22
+ runTest ( `var x = 0;` , { } , /*expectedOutput*/ undefined , /*expectedDiagnosticCodes*/ [ 5047 ] ) ;
23
23
} ) ;
24
24
25
25
it ( "Generates no diagnostics with valid inputs" , ( ) => {
26
26
// No errors
27
- runTest ( `var x = 0;` , { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , [ ] ) ;
27
+ runTest ( `var x = 0;` , { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , /*expectedDiagnosticCodes*/ [ ] ) ;
28
28
} ) ;
29
29
30
30
it ( "Generates no diagnostics for missing file references" , ( ) => {
31
31
runTest ( `/// <reference path="file2.ts" />
32
32
var x = 0;` ,
33
- { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , [ ] ) ;
33
+ { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , /*expectedDiagnosticCodes*/ [ ] ) ;
34
34
} ) ;
35
35
36
36
it ( "Generates no diagnostics for missing module imports" , ( ) => {
37
37
runTest ( `import {a} from "module2";` ,
38
- { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , [ ] ) ;
38
+ { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , /*expectedDiagnosticCodes*/ [ ] ) ;
39
39
} ) ;
40
40
41
41
it ( "Generates expected syntactic diagnostics" , ( ) => {
42
42
runTest ( `a b` ,
43
- { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , [ 1005 ] ) ; /// 1005: ';' Expected
43
+ { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , /*expectedDiagnosticCodes*/ [ 1005 ] ) ; /// 1005: ';' Expected
44
44
} ) ;
45
45
46
46
it ( "Does not generate semantic diagnostics" , ( ) => {
47
47
runTest ( `var x: string = 0;` ,
48
- { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , [ ] ) ;
48
+ { module : ModuleKind . CommonJS } , /*expectedOutput*/ undefined , /*expectedDiagnosticCodes*/ [ ] ) ;
49
49
} ) ;
50
50
51
51
it ( "Generates module output" , ( ) => {
52
52
runTest ( `var x = 0;` , { module : ModuleKind . AMD } , `define(["require", "exports"], function (require, exports) {\r\n var x = 0;\r\n});\r\n` ) ;
53
53
} ) ;
54
54
55
55
it ( "Uses correct newLine character" , ( ) => {
56
- runTest ( `var x = 0;` , { module : ModuleKind . CommonJS , newLine : NewLineKind . LineFeed } , `var x = 0;\n` ) ;
56
+ runTest ( `var x = 0;` , { module : ModuleKind . CommonJS , newLine : NewLineKind . LineFeed } , `var x = 0;\n` , /*expectedDiagnosticCodes*/ [ ] ) ;
57
57
} ) ;
58
58
} ) ;
59
59
}
0 commit comments