diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index f556b6e47f6..9dbe52dea2d 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -294,8 +294,11 @@ namespace Harness { noTypesAndSymbols?: boolean; } + // Ensure that each value has a corresponding property in HarnessOptions + type ValidOption = keyof HarnessOptions | keyof ts.CompilerOptions; + // Additional options not already in ts.optionDeclarations - const harnessOptionDeclarations: ts.CommandLineOption[] = [ + const harnessOptionDeclarations: Array = [ { name: "allowNonTsExtensions", type: "boolean" }, { name: "useCaseSensitiveFileNames", type: "boolean" }, { name: "baselineFile", type: "string" }, @@ -462,7 +465,7 @@ namespace Harness { if (options.declaration && result.diagnostics.length === 0 && result.dts.size > 0) { ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles)); ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); - return { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory: currentDirectory || harnessSettings.currentDirectory }; + return { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory: (currentDirectory ?? harnessSettings.currentDirectory) || "" }; } function addDtsFile(file: TestFile, dtsFiles: TestFile[]) {