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:
Sheetal Nandi
2022-10-31 10:15:19 -07:00
committed by GitHub
parent 18f559faf9
commit cfa55f1c2d
11 changed files with 282 additions and 1080 deletions

View File

@@ -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

View File

@@ -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"],
}
]
});
});
}

View File

@@ -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 });
},