@@ -22,8 +22,7 @@ namespace RWC {
22
22
}
23
23
24
24
function isTsConfigFile ( file : { path : string } ) : boolean {
25
- const tsConfigFileName = "tsconfig.json" ;
26
- return file . path . substr ( file . path . length - tsConfigFileName . length ) . toLowerCase ( ) === tsConfigFileName ;
25
+ return file . path . indexOf ( "tsconfig" ) !== - 1 && file . path . indexOf ( "json" ) !== - 1 ;
27
26
}
28
27
29
28
export function runRWCTest ( jsonPath : string ) {
@@ -213,13 +212,13 @@ namespace RWC {
213
212
it ( "has the expected errors in generated declaration files" , ( ) => {
214
213
if ( compilerOptions . declaration && ! compilerResult . errors . length ) {
215
214
Harness . Baseline . runBaseline ( `${ baseName } .dts.errors.txt` , ( ) => {
216
- const declFileCompilationResult = Harness . Compiler . compileDeclarationFiles (
217
- inputFiles , otherFiles , compilerResult , /*harnessSettings*/ undefined , compilerOptions , currentDirectory ) ;
218
-
219
- if ( declFileCompilationResult . declResult . errors . length === 0 ) {
215
+ if ( compilerResult . errors . length === 0 ) {
220
216
return null ;
221
217
}
222
218
219
+ const declFileCompilationResult = Harness . Compiler . compileDeclarationFiles (
220
+ inputFiles , otherFiles , compilerResult , /*harnessSettings*/ undefined , compilerOptions , currentDirectory ) ;
221
+
223
222
return Harness . Compiler . minimalDiagnosticsToString ( declFileCompilationResult . declResult . errors ) +
224
223
Harness . IO . newLine ( ) + Harness . IO . newLine ( ) +
225
224
Harness . Compiler . getErrorBaseline ( tsconfigFiles . concat ( declFileCompilationResult . declInputFiles , declFileCompilationResult . declOtherFiles ) , declFileCompilationResult . declResult . errors ) ;
0 commit comments