Skip to content

Commit a7fe9db

Browse files
authored
Merge pull request #16847 from Microsoft/master-RWC
[master] fix RWC runner
2 parents 4e6e1d1 + 67faecc commit a7fe9db

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/harness/rwcRunner.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ namespace RWC {
2222
}
2323

2424
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;
2726
}
2827

2928
export function runRWCTest(jsonPath: string) {
@@ -213,13 +212,13 @@ namespace RWC {
213212
it("has the expected errors in generated declaration files", () => {
214213
if (compilerOptions.declaration && !compilerResult.errors.length) {
215214
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) {
220216
return null;
221217
}
222218

219+
const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles(
220+
inputFiles, otherFiles, compilerResult, /*harnessSettings*/ undefined, compilerOptions, currentDirectory);
221+
223222
return Harness.Compiler.minimalDiagnosticsToString(declFileCompilationResult.declResult.errors) +
224223
Harness.IO.newLine() + Harness.IO.newLine() +
225224
Harness.Compiler.getErrorBaseline(tsconfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.errors);

0 commit comments

Comments
 (0)