mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 10:46:28 -05:00
Enable other stripinternal test cases
This commit is contained in:
@@ -798,7 +798,7 @@ namespace ts {
|
||||
if (bundleFileInfo) {
|
||||
const newSections = bundleFileInfo.sections;
|
||||
bundleFileInfo.sections = savedSections!;
|
||||
if (prepend.oldFileOfCurrentEmit) bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: BundleFileSectionKind.Text });
|
||||
if (prepend.oldFileOfCurrentEmit) bundleFileInfo.sections.push(...newSections);
|
||||
else {
|
||||
newSections.forEach(section => Debug.assert(isBundleFileTextLike(section)));
|
||||
bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: BundleFileSectionKind.Prepend, data: (prepend as UnparsedSource).fileName, texts: newSections as BundleFileTextLike[] });
|
||||
|
||||
@@ -158,10 +158,10 @@ namespace ts {
|
||||
[Diagnostics.Building_project_0, sources[project.first][source.config]],
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_javascript_and_source_map_if_specified_of_its_dependency_1_has_changed, relSources[project.second][source.config], "src/first"],
|
||||
[Diagnostics.Updating_output_javascript_and_javascript_source_map_if_specified_of_project_0, sources[project.second][source.config]],
|
||||
...getUnchangedOutputTimeStampUpdate(project.second),
|
||||
[Diagnostics.Updating_unchanged_output_timestamps_of_project_0, sources[project.second][source.config]],
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_javascript_and_source_map_if_specified_of_its_dependency_1_has_changed, relSources[project.third][source.config], "src/second"],
|
||||
[Diagnostics.Updating_output_javascript_and_javascript_source_map_if_specified_of_project_0, sources[project.third][source.config]],
|
||||
...getUnchangedOutputTimeStampUpdate(project.third),
|
||||
...getUnchangedOutputTimeStampUpdateOfProjectThree(),
|
||||
] :
|
||||
[
|
||||
getExpectedDiagnosticForProjectsInBuild(relSources[project.first][source.config], relSources[project.second][source.config], relSources[project.third][source.config]),
|
||||
@@ -170,7 +170,7 @@ namespace ts {
|
||||
[Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, relSources[project.second][source.config], relSources[project.second][source.ts][part.one], relOutputFiles[project.second][ext.js]],
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_javascript_and_source_map_if_specified_of_its_dependency_1_has_changed, relSources[project.third][source.config], "src/first"],
|
||||
[Diagnostics.Updating_output_javascript_and_javascript_source_map_if_specified_of_project_0, sources[project.third][source.config]],
|
||||
...getUnchangedOutputTimeStampUpdate(project.third),
|
||||
...getUnchangedOutputTimeStampUpdateOfProjectThree(),
|
||||
],
|
||||
expectedReadFiles: getReadFilesMap(
|
||||
[
|
||||
@@ -313,9 +313,9 @@ namespace ts {
|
||||
}
|
||||
});
|
||||
|
||||
function getUnchangedOutputTimeStampUpdate(project: project): ReadonlyArray<fakes.ExpectedDiagnostic> {
|
||||
function getUnchangedOutputTimeStampUpdateOfProjectThree(): ReadonlyArray<fakes.ExpectedDiagnostic> {
|
||||
return !unchangedDtsWritesThirdDts ?
|
||||
[[Diagnostics.Updating_unchanged_output_timestamps_of_project_0, sources[project][source.config]]] :
|
||||
[[Diagnostics.Updating_unchanged_output_timestamps_of_project_0, sources[project.third][source.config]]] :
|
||||
emptyArray;
|
||||
}
|
||||
}
|
||||
@@ -648,59 +648,66 @@ ${internal} enum internalEnum { a, b, c }`);
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal with comments emit enabled",
|
||||
// modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true),
|
||||
// modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface")
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal with comments emit enabled",
|
||||
modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true),
|
||||
modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"),
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal jsdoc style comment",
|
||||
// modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true),
|
||||
// modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface")
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal jsdoc style comment",
|
||||
modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true),
|
||||
modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"),
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal jsdoc style with comments emit enabled",
|
||||
// modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true),
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal jsdoc style with comments emit enabled",
|
||||
modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true),
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// function makeOneTwoThreeDependOrder(fs: vfs.FileSystem) {
|
||||
// replaceText(fs, sources[project.second][source.config], "[", `[
|
||||
//{ "path": "../first", "prepend": true }`);
|
||||
// replaceText(fs, sources[project.third][source.config], `{ "path": "../first", "prepend": true },`, "");
|
||||
// }
|
||||
function makeOneTwoThreeDependOrder(fs: vfs.FileSystem) {
|
||||
replaceText(fs, sources[project.second][source.config], "[", `[
|
||||
{ "path": "../first", "prepend": true }`);
|
||||
replaceText(fs, sources[project.third][source.config], `{ "path": "../first", "prepend": true },`, "");
|
||||
}
|
||||
|
||||
// function stripInternalWithDependentOrder(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) {
|
||||
// stripInternalScenario(fs, removeCommentsDisabled, jsDocStyle);
|
||||
// makeOneTwoThreeDependOrder(fs);
|
||||
// }
|
||||
function stripInternalWithDependentOrder(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) {
|
||||
stripInternalScenario(fs, removeCommentsDisabled, jsDocStyle);
|
||||
makeOneTwoThreeDependOrder(fs);
|
||||
}
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal when one-two-three are prepended in order",
|
||||
// modifyFs: fs => stripInternalWithDependentOrder(fs),
|
||||
// modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"),
|
||||
// dependOrdered: true
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal when one-two-three are prepended in order",
|
||||
modifyFs: fs => stripInternalWithDependentOrder(fs),
|
||||
modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"),
|
||||
dependOrdered: true,
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal with comments emit enabled when one-two-three are prepended in order",
|
||||
// modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true),
|
||||
// modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"),
|
||||
// dependOrdered: true
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal with comments emit enabled when one-two-three are prepended in order",
|
||||
modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true),
|
||||
modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"),
|
||||
dependOrdered: true,
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal jsdoc style comment when one-two-three are prepended in order",
|
||||
// modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true),
|
||||
// modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"),
|
||||
// dependOrdered: true
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal jsdoc style comment when one-two-three are prepended in order",
|
||||
modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true),
|
||||
modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"),
|
||||
dependOrdered: true,
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
|
||||
// verifyOutFileScenario({
|
||||
// scenario: "stripInternal jsdoc style with comments emit enabled when one-two-three are prepended in order",
|
||||
// modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true),
|
||||
// dependOrdered: true
|
||||
// });
|
||||
verifyOutFileScenario({
|
||||
scenario: "stripInternal jsdoc style with comments emit enabled when one-two-three are prepended in order",
|
||||
modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true),
|
||||
dependOrdered: true,
|
||||
unchangedDtsWritesThirdDts: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user