mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixes the tests that got disabled when generating config set es2016 expecting to find libFile and remove incorrect affects flag from listFilesOnly (#51243)
* Fix the existing test * Remove affectsEmit from listFilesOnly
This commit is contained in:
@@ -436,9 +436,6 @@ namespace ts {
|
||||
name: "listFilesOnly",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Command_line_Options,
|
||||
affectsSemanticDiagnostics: true,
|
||||
affectsEmit: true,
|
||||
affectsMultiFileEmitBuildInfo: true,
|
||||
isCommandLineOnly: true,
|
||||
description: Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
|
||||
defaultValueDescription: false,
|
||||
@@ -2411,7 +2408,8 @@ namespace ts {
|
||||
return config;
|
||||
}
|
||||
|
||||
function optionMapToObject(optionMap: ESMap<string, CompilerOptionsValue>): object {
|
||||
/*@internal*/
|
||||
export function optionMapToObject(optionMap: ESMap<string, CompilerOptionsValue>): object {
|
||||
return {
|
||||
...arrayFrom(optionMap.entries()).reduce((prev, cur) => ({ ...prev, [cur[0]]: cur[1] }), {}),
|
||||
};
|
||||
@@ -2464,7 +2462,8 @@ namespace ts {
|
||||
});
|
||||
}
|
||||
|
||||
function serializeCompilerOptions(
|
||||
/* @internal */
|
||||
export function serializeCompilerOptions(
|
||||
options: CompilerOptions,
|
||||
pathOptions?: { configFilePath: string, useCaseSensitiveFileNames: boolean }
|
||||
): ESMap<string, CompilerOptionsValue> {
|
||||
|
||||
@@ -6,6 +6,10 @@ namespace ts {
|
||||
storeFilesChangingSignatureDuringEmit?: boolean;
|
||||
};
|
||||
|
||||
export function compilerOptionsToConfigJson(options: CompilerOptions) {
|
||||
return optionMapToObject(serializeCompilerOptions(options));
|
||||
}
|
||||
|
||||
export const noChangeRun: TestTscEdit = {
|
||||
subScenario: "no-change-run",
|
||||
modifyFs: noop
|
||||
|
||||
@@ -19,5 +19,26 @@ namespace ts {
|
||||
}),
|
||||
commandLineArgs: ["/src/test.ts", "--listFilesOnly"]
|
||||
});
|
||||
|
||||
verifyTscWithEdits({
|
||||
scenario: "listFilesOnly",
|
||||
subScenario: "combined with incremental",
|
||||
fs: () => loadProjectFromFiles({
|
||||
"/src/test.ts": `export const x = 1;`,
|
||||
"/src/tsconfig.json": "{}"
|
||||
}),
|
||||
commandLineArgs: ["-p", "/src", "--incremental", "--listFilesOnly"],
|
||||
edits: [
|
||||
{
|
||||
...noChangeRun,
|
||||
commandLineArgs: ["-p", "/src", "--incremental"],
|
||||
},
|
||||
noChangeRun,
|
||||
{
|
||||
...noChangeRun,
|
||||
commandLineArgs: ["-p", "/src", "--incremental"],
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1164,7 +1164,9 @@ declare const eval: any`
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: `${projectRoot}/tsconfig.json`,
|
||||
content: generateTSConfig(options, emptyArray, "\n")
|
||||
content: JSON.stringify({
|
||||
compilerOptions: compilerOptionsToConfigJson(options)
|
||||
})
|
||||
};
|
||||
return createWatchedSystem([file1, file2, libFile, tsconfig], { currentDirectory: projectRoot });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user