@@ -28,12 +28,6 @@ module RWC {
2828 var compilerOptions : ts . CompilerOptions ;
2929 var baselineOpts : Harness . Baseline . BaselineOptions = { Subfolder : 'rwc' } ;
3030 var baseName = / ( .* ) \/ ( .* ) .j s o n / . exec ( ts . normalizeSlashes ( jsonPath ) ) [ 2 ] ;
31- // Compile .d.ts files
32- var declFileCompilationResult : {
33- declInputFiles : { unitName : string ; content : string } [ ] ;
34- declOtherFiles : { unitName : string ; content : string } [ ] ;
35- declResult : Harness . Compiler . CompilerResult ;
36- } ;
3731
3832 after ( ( ) => {
3933 // Mocha holds onto the closure environment of the describe callback even after the test is done.
@@ -44,7 +38,6 @@ module RWC {
4438 compilerOptions = undefined ;
4539 baselineOpts = undefined ;
4640 baseName = undefined ;
47- declFileCompilationResult = undefined ;
4841 } ) ;
4942
5043 it ( 'can compile' , ( ) => {
@@ -103,11 +96,6 @@ module RWC {
10396 }
10497 } ) ;
10598
106- // Baselines
107- it ( 'Correct compiler generated.d.ts' , ( ) => {
108- declFileCompilationResult = Harness . Compiler . getCompiler ( ) . compileDeclarationFiles ( inputFiles , otherFiles , compilerResult , /*settingscallback*/ undefined , compilerOptions ) ;
109- } ) ;
110-
11199
112100 it ( 'has the expected emitted code' , ( ) => {
113101 Harness . Baseline . runBaseline ( 'has the expected emitted code' , baseName + '.output.js' , ( ) => {
@@ -152,9 +140,12 @@ module RWC {
152140 } , false , baselineOpts ) ;
153141 } ) ;
154142
155- it ( 'has no errors in generated declaration files' , ( ) => {
143+ // Ideally, a generated declaration file will have no errors. But we allow generated
144+ // declaration file errors as part of the baseline.
145+ it ( 'has the expected errors in generated declaration files' , ( ) => {
156146 if ( compilerOptions . declaration && ! compilerResult . errors . length ) {
157- Harness . Baseline . runBaseline ( 'has no errors in generated declaration files' , baseName + '.dts.errors.txt' , ( ) => {
147+ Harness . Baseline . runBaseline ( 'has the expected errors in generated declaration files' , baseName + '.dts.errors.txt' , ( ) => {
148+ var declFileCompilationResult = Harness . Compiler . getCompiler ( ) . compileDeclarationFiles ( inputFiles , otherFiles , compilerResult , /*settingscallback*/ undefined , compilerOptions ) ;
158149 if ( declFileCompilationResult . declResult . errors . length === 0 ) {
159150 return null ;
160151 }
0 commit comments